summaryrefslogtreecommitdiffstats
path: root/drivers/leds/led-class.c
diff options
context:
space:
mode:
authorNémeth Márton <nm127@freemail.hu>2008-03-09 20:54:37 +0000
committerRichard Purdie <rpurdie@rpsys.net>2008-04-24 23:34:18 +0100
commit0013b23d66a2768f5babbb0ea9f03ab067a990d8 (patch)
tree14d60a50bb68e422767a268cd737f70ef4e6e19d /drivers/leds/led-class.c
parentb3ba31f84ea041c0945b5904d4c407ce14b2b72c (diff)
downloadlinux-0013b23d66a2768f5babbb0ea9f03ab067a990d8.tar.gz
linux-0013b23d66a2768f5babbb0ea9f03ab067a990d8.tar.bz2
linux-0013b23d66a2768f5babbb0ea9f03ab067a990d8.zip
leds: disable triggers on brightness set
Disable any active triggers when the brightness attribute is set to zero. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/leds/led-class.c')
-rw-r--r--drivers/leds/led-class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 63aad90247c4..a8dd59ebedf8 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -51,6 +51,9 @@ static ssize_t led_brightness_store(struct device *dev,
if (count == size) {
ret = count;
+
+ if (state == LED_OFF)
+ led_trigger_remove(led_cdev);
led_set_brightness(led_cdev, state);
}