[PATCH] leds: Add options to have GPIO LEDs start on or keep their state

Trent Piepho xyzzy at speakeasy.org
Thu May 14 04:54:28 EST 2009


On Wed, 13 May 2009, Wolfram Sang wrote:
> > diff --git a/include/linux/leds.h b/include/linux/leds.h
> > index 376fe07..66e7d75 100644
> > --- a/include/linux/leds.h
> > +++ b/include/linux/leds.h
> > @@ -141,9 +141,14 @@ struct gpio_led {
> >  	const char *name;
> >  	const char *default_trigger;
> >  	unsigned 	gpio;
> > -	u8 		active_low : 1;
> > -	u8		retain_state_suspended : 1;
> > +	unsigned	active_low : 1;
> > +	unsigned	retain_state_suspended : 1;
> > +	unsigned	default_state : 2;
> > +	/* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
>
> Any specific reason for the change from u8 to unsigned? Could be
> mentioned in the patch description maybe. And what Sean mentioned :)

I should have mentioned that in the description.  It didn't make sense to
me to declare a bit field with u8.  An eight bit type that is one bit
wide?  The field width overrides the type width, but I think it's better to
just use "unsigned" and only specify a width once.

>
> Other than that:
>
> Acked-by: Wolfram Sang <w.sang at pengutronix.de>
>
> --
> Pengutronix e.K.                           | Wolfram Sang                |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
>



More information about the Linuxppc-dev mailing list