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

login
register
mail settings
Submitter Otavio Salvador
Date Sept. 28, 2013, 3:24 a.m.
Message ID <1380338659-7896-4-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/278705/
State Superseded
Headers show

Comments

Otavio Salvador - Sept. 28, 2013, 3:24 a.m.
This avoid logic code duplication and is need to fix __led_toggle
later.

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

Patch

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)