[PATCH] [wip] ARM: imx: register "leds-gpio" device using new helper function

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Wed May 11 02:22:57 EDT 2011


Hello Hartley,

On Tue, May 10, 2011 at 05:26:18PM -0500, H Hartley Sweeten wrote:
> On Tuesday, May 10, 2011 1:51 AM, Uwe Kleine-König wrote:
> > diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
> > index fa5288018..3479f66 100644
> > --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
> > +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
> > @@ -113,7 +113,7 @@ eukrea_mbimx27_keymap_data __initconst = {
> >  	.keymap_size    = ARRAY_SIZE(eukrea_mbimx27_keymap),
> >  };
> >  
> > -static struct gpio_led gpio_leds[] = {
> > +static const struct gpio_led gpio_leds[] __initconst = {
> >  	{
> >  		.name			= "led1",
> >  		.default_trigger	= "heartbeat",
> > @@ -128,19 +128,11 @@ static struct gpio_led gpio_leds[] = {
> >  	},
> >  };
> >  
> > -static struct gpio_led_platform_data gpio_led_info = {
> > +static const struct gpio_led_platform_data gpio_led_info __initconst = {
> >  	.leds		= gpio_leds,
> >  	.num_leds	= ARRAY_SIZE(gpio_leds),
> >  };
> 
> Just a note that the 'const' you added to struct gpio_led above will be
> discarded in struct gpio_led_platform_data.  You will get something like:
> 
> arch/arm/mach-imx/eukrea_mbimx27-baseboard.c:132: warning: initialization discards qualifiers from pointer target type
It seems you don't have

	9517f92 (leds: make *struct gpio_led_platform_data.leds const)

(contained in .39-rc1) in your tree :-)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



More information about the linux-arm-kernel mailing list