summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorStefan Sørensen <stefan.sorensen@spectralink.com>2014-02-04 00:11:42 -0800
committerBryan Wu <cooloney@gmail.com>2014-02-27 09:56:55 -0800
commit8d82fef8bbee588d071372eb02439d2053b4bfe4 (patch)
tree8cc6f5382e1b7f6d7e51821a5733b45b90f7a967 /drivers/leds
parentfba14ae8e924881038406ecff031d2d17becc2cb (diff)
downloadop-kernel-dev-8d82fef8bbee588d071372eb02439d2053b4bfe4.zip
op-kernel-dev-8d82fef8bbee588d071372eb02439d2053b4bfe4.tar.gz
leds: Turn off led if blinking is disabled
When using the timer trigger and setting delay_on to 0, the led will stay in whatever state is was in, while intuitively one would expect it to turn off. This patch changes the behaviour to turn it off. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/led-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index ce8921a..71b40d3 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -39,9 +39,11 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
led_cdev->blink_delay_on = delay_on;
led_cdev->blink_delay_off = delay_off;
- /* never on - don't blink */
- if (!delay_on)
+ /* never on - just set to off */
+ if (!delay_on) {
+ __led_set_brightness(led_cdev, LED_OFF);
return;
+ }
/* never off - just set to brightness */
if (!delay_off) {
OpenPOWER on IntegriCloud