[patch 1/1] leds-gpio: fix gpio init.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The GPIOF_INIT_* flags are shifted by 1, so the value of 
led_dat->active_low ^ state should be shifted by one too. Not doing it results
in active-low gpio being configured as input.

Signed-off-by: Arnaud Patard <arnaud.patard@xxxxxxxxxxx>
Index: sascha-new/drivers/leds/leds-gpio.c
===================================================================
--- sascha-new.orig/drivers/leds/leds-gpio.c	2012-12-26 16:24:06.050622067 +0100
+++ sascha-new/drivers/leds/leds-gpio.c	2012-12-26 16:36:24.370589583 +0100
@@ -127,7 +127,7 @@ static int create_gpio_led(const struct
 		led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;
 
 	ret = devm_gpio_request_one(parent, template->gpio,
-			GPIOF_DIR_OUT | (led_dat->active_low ^ state),
+			GPIOF_DIR_OUT | ((led_dat->active_low ^ state) << 1),
 			template->name);
 	if (ret < 0)
 		return ret;


--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux