Skip to content

Commit

Permalink
[PATCH] leds: turn LED off when changing triggers
Browse files Browse the repository at this point in the history
I was playing with LED triggers when I noticed that changing from heartbeat
(or ide-disk) to "none" at the right moment would leave the LED stuck on.
This is easy to reproduce by doing "find / >/dev/null" with the ide-disk
trigger enabled and then switching to "none".

Here is a patch that fixes the problem by explicitly turning the LED off
after removing the existing trigger.

Signed-off-by: Paul Collins <paul@ondioline.org>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Paul Collins authored and Linus Torvalds committed Oct 1, 2006
1 parent fd7bcea commit e3e5fc9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/leds/led-triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger)
write_unlock_irqrestore(&led_cdev->trigger->leddev_list_lock, flags);
if (led_cdev->trigger->deactivate)
led_cdev->trigger->deactivate(led_cdev);
led_set_brightness(led_cdev, LED_OFF);
}
if (trigger) {
write_lock_irqsave(&trigger->leddev_list_lock, flags);
Expand Down

0 comments on commit e3e5fc9

Please sign in to comment.