Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
leds: Turn off led if blinking is disabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ssorensen authored and cooloney committed Feb 27, 2014
1 parent fba14ae commit 8d82fef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/leds/led-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8d82fef

Please sign in to comment.