[U-Boot] [PATCH 4/7] gpio-led: Use __led_set in __led_init code

Otavio Salvador otavio at ossystems.com.br
Sat Sep 28 05:24:15 CEST 2013


This avoid logic code duplication and is need to fix __led_toggle
later.

Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---
 drivers/misc/gpio_led.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/gpio_led.c b/drivers/misc/gpio_led.c
index 3fedddc..6afb986 100644
--- a/drivers/misc/gpio_led.c
+++ b/drivers/misc/gpio_led.c
@@ -12,12 +12,12 @@
 void __led_init(led_id_t mask, int state)
 {
 	gpio_request(mask, "gpio_led");
-	gpio_direction_output(mask, state == STATUS_LED_ON);
+	__led_set(mask, state);
 }
 
 void __led_set(led_id_t mask, int state)
 {
-	gpio_set_value(mask, state == STATUS_LED_ON);
+	gpio_direction_output(mask, state == STATUS_LED_ON);
 }
 
 void __led_toggle(led_id_t mask)
-- 
1.8.4.rc3



More information about the U-Boot mailing list