mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Collins <paul@briny.ondioline.org>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] leds: turn LED off when changing triggers
Date: Tue, 19 Sep 2006 15:21:00 +1200	[thread overview]
Message-ID: <87u034y21v.fsf@briny.internal.ondioline.org> (raw)

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

             reply	other threads:[~2006-09-19  3:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-19  3:21 Paul Collins [this message]
2006-09-19 21:18 ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87u034y21v.fsf@briny.internal.ondioline.org \
    --to=paul@briny.ondioline.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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