LED devices

Richard Purdie rpurdie at openedhand.com
Fri Jun 1 05:18:41 PDT 2007


On Fri, 2007-06-01 at 13:04 +0100, Richard Hughes wrote:
> On Fri, 2007-06-01 at 12:56 +0100, Richard Purdie wrote:
> > > Richard, would you let me write a patch to fix this or are you already
> > > doing this? Thanks.
> > 
> > I'd started something, I've finished it off and added it to the LEDs
> > tree:
> > 
> > http://git.o-hand.com/?p=linux-rpurdie-leds;a=shortlog;h=for-mm
[...]
> Why not just add to the API to do:
> 
> static struct led_classdev standby_led = {
> 	.name			= "thinkpad_standby",
> 	.color			= "green",
> 	.default_trigger	= "none",
> 	.brightness_set		= led_standby_set,
> };

Several reasons:

* I want to keep the names descriptive (which is allowed afaict)
* If we remove colour from the names we break the existing API as
documented.
* Drivers should only specify the colour in one place.
* With this approach we only need to add a method to the core, not
change every LED driver.


Regards,

Richard






More information about the hal mailing list