mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] leds: turn LED off when changing triggers
@ 2006-09-19  3:21 Paul Collins
  2006-09-19 21:18 ` Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Collins @ 2006-09-19  3:21 UTC (permalink / raw)
  To: Richard Purdie; +Cc: linux-kernel

Hi Richard,

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>

diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 47f0ff1..454fb09 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -125,6 +125,7 @@ void led_trigger_set(struct led_classdev
 		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);


-- 
Paul Collins
Wellington, New Zealand

Dag vijandelijk luchtschip de huismeester is dood

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] leds: turn LED off when changing triggers
  2006-09-19  3:21 [PATCH] leds: turn LED off when changing triggers Paul Collins
@ 2006-09-19 21:18 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2006-09-19 21:18 UTC (permalink / raw)
  To: Paul Collins, akpm; +Cc: linux-kernel

On Tue, 2006-09-19 at 15:21 +1200, Paul Collins wrote:
> 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.

Looks good to me, thanks.

> Signed-off-by: Paul Collins <paul@ondioline.org>
Acked-by: Richard Purdie <rpurdie@rpsys.net>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-19 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-19  3:21 [PATCH] leds: turn LED off when changing triggers Paul Collins
2006-09-19 21:18 ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome