From: Thadeu Lima de Souza Cascardo Date: Wed, 26 Aug 2009 21:29:32 +0000 (-0700) Subject: leds: after setting inverted attribute, we must update the LED X-Git-Tag: v2.6.31-rc8~13 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=cc674c81f01a6151ca00c617e5efa0812ee5fdbe;ds=sidebyside leds: after setting inverted attribute, we must update the LED If we change the inverted attribute to another value, the LED will not be inverted until we change the GPIO state. Signed-off-by: Thadeu Lima de Souza Cascardo Cc: Samuel R. C. Vale Cc: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/leds/ledtrig-gpio.c b/drivers/leds/ledtrig-gpio.c index 8183b81fca84..1bc5db4ece0d 100644 --- a/drivers/leds/ledtrig-gpio.c +++ b/drivers/leds/ledtrig-gpio.c @@ -117,6 +117,9 @@ static ssize_t gpio_trig_inverted_store(struct device *dev, gpio_data->inverted = !!inverted; + /* After inverting, we need to update the LED. */ + schedule_work(&gpio_data->work); + return n; } static DEVICE_ATTR(inverted, 0644, gpio_trig_inverted_show,