public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbou@mail.ru>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: kogiidena@eggplant.ddo.jp, linux-kernel@vger.kernel.org,
	lethal@linux-sh.org
Subject: Re: [PATCH 1/2] leds:arch/sh/boards/landisk LEDs supports
Date: Tue, 15 May 2007 00:12:56 +0400	[thread overview]
Message-ID: <20070514201256.GB26554@zarina> (raw)
In-Reply-To: <1179098182.5883.31.camel@localhost.localdomain>

On Mon, May 14, 2007 at 12:16:22AM +0100, Richard Purdie wrote:
> On Wed, 2007-05-09 at 20:03 +0400, Anton Vorontsov wrote:
> > +	led_cdev->trigger = trigger;
> >  	if (trigger) {
> >  		write_lock_irqsave(&trigger->leddev_list_lock, flags);
> >  		list_add_tail(&led_cdev->trig_list, &trigger->led_cdevs);
> > @@ -134,7 +140,6 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger)
> >  		if (trigger->activate)
> >  			trigger->activate(led_cdev);
> >  	}
> > -	led_cdev->trigger = trigger;
> >  }
> >  
> >  void led_trigger_set_default(struct led_classdev *led_cdev)
> 
> Why was the above was changed?
> 
> I think we've discussed this before

Yup.

> and it would be better to add a
> trigger parameter to activate/deactivate if we really need it.

Well.. Passing trigger parameter to activate/deactivate function is not
only purpose of that patch...


From: Anton Vorontsov <cbou@mail.ru>
Date: Mon, 14 May 2007 23:49:09 +0400
Subject: [PATCH] Attach trigger to LED prior calling activate function.

This change needed for two purposes:

1. When somebody sets trigger, and that trigger would setup
   brightness in its activate() function, and led driver would check
   if that trigger supported (used by hwtimer trigger and drivers
   supporting hw blinking LEDs, not in mainline yet).

2. If trigger would access itself through led_cdev in its activate()
   function.

Pros of that patch:

1. Just sane to do;
2. Trivial;
3. Can't break anything;
4. No new code, just one line movement.

Cons of applying that patch:

1. No mainline kernel user, but offshores.

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
---
 drivers/leds/led-triggers.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 7fde7d0..d3ab5d0 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -134,6 +134,7 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger)
 			led_cdev->trigger->deactivate(led_cdev);
 		led_set_brightness(led_cdev, LED_OFF);
 	}
+	led_cdev->trigger = trigger;
 	if (trigger) {
 		write_lock_irqsave(&trigger->leddev_list_lock, flags);
 		list_add_tail(&led_cdev->trig_list, &trigger->led_cdevs);
@@ -141,7 +142,6 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger)
 		if (trigger->activate)
 			trigger->activate(led_cdev);
 	}
-	led_cdev->trigger = trigger;
 }
 
 void led_trigger_set_default(struct led_classdev *led_cdev)
-- 
1.5.1.1-dirty


  parent reply	other threads:[~2007-05-14 20:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08 12:26 [PATCH 1/2] leds:arch/sh/boards/landisk LEDs supports kogiidena
2007-05-08 12:54 ` Richard Purdie
2007-05-09 14:26   ` kogiidena
2007-05-09 15:13     ` Richard Purdie
2007-05-09 16:03       ` Anton Vorontsov
2007-05-10 11:52         ` kogiidena
2007-05-10 14:04           ` Paul Mundt
2007-05-11 15:03             ` kogiidena
2007-05-12  4:01               ` kogiidena
2007-05-13 23:16         ` Richard Purdie
2007-05-14 19:56           ` Anton Vorontsov
2007-05-14 20:12           ` Anton Vorontsov [this message]
2007-05-14 20:33             ` Richard Purdie
2007-05-14 21:13               ` Anton Vorontsov
2007-05-09 21:48       ` kogiidena

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=20070514201256.GB26554@zarina \
    --to=cbou@mail.ru \
    --cc=kogiidena@eggplant.ddo.jp \
    --cc=lethal@linux-sh.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