[PATCH v3] leds: provide helper to register "leds-gpio" devices

Richard Purdie rpurdie at rpsys.net
Fri May 6 17:03:22 EDT 2011


On Wed, 2011-04-13 at 08:23 +0200, Uwe Kleine-König wrote:
> On Tue, Apr 12, 2011 at 10:48:48PM +0100, Russell King - ARM Linux wrote:
> > On Mon, Apr 11, 2011 at 10:35:57PM +0200, Uwe Kleine-König wrote:
> > > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > > index 9bec869..e8e101e 100644
> > > --- a/drivers/leds/Kconfig
> > > +++ b/drivers/leds/Kconfig
> > > @@ -14,6 +14,11 @@ config LEDS_CLASS
> > >  	  This option enables the led sysfs class in /sys/class/leds.  You'll
> > >  	  need this to do anything useful with LEDs.  If unsure, say N.
> > >  
> > > +config LED_REGISTER_GPIO
> > > +	bool
> > > +	help
> > > +	  This option provides the function gpio_led_register_device.
> > > +
> > >  if NEW_LEDS
> > >  
> > >  comment "LED drivers"
> > > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> > > index 39c80fc..ca428bd 100644
> > > --- a/drivers/leds/Makefile
> > > +++ b/drivers/leds/Makefile
> > > @@ -3,6 +3,7 @@
> > >  obj-$(CONFIG_NEW_LEDS)			+= led-core.o
> > >  obj-$(CONFIG_LEDS_CLASS)		+= led-class.o
> > >  obj-$(CONFIG_LEDS_TRIGGERS)		+= led-triggers.o
> > > +obj-y					+= led-register.o
> > 
> > Why not obj-$(CONFIG_LED_REGISTER_GPIO) += led-register.o
> > 
> > rather than wrapping the code of led-register.c with a #ifdef for the
> > same symbol?
> I thought that the registration for other led-devices could go into that
> file, too. That's why I choosed the name led-register and not
> leds-gpio-register.c. Agreed? I don't insist on that.

I'm not sure we want/need to put other registration functions in this
file? obj-$(CONFIG_LED_REGISTER_GPIO) probably therefore makes sense
until some other registration need arises.

Regardless, I'm happier with this patch than the previous ones. If you
change it to use obj-$(CONFIG_LED_REGISTER_GPIO), 

Acked-by: Richard Purdie <richard.purdie at linuxfoundation.org>

Cheers,

Richard

-- 
Linux Foundation
http://www.yoctoproject.org/




More information about the linux-arm-kernel mailing list