| To: | Aurelien Jarno <aurelien@aurel32.net> |
|---|---|
| Subject: | Re: [PATCH -mm][MIPS] GPIO LED driver for the WGT634U machine |
| From: | Geert Uytterhoeven <geert@linux-m68k.org> |
| Date: | Wed, 15 Aug 2007 18:00:55 +0200 (CEST) |
| Cc: | Andrew Morton <akpm@linux-foundation.org>, linux-mips@linux-mips.org |
| In-reply-to: | <Pine.LNX.4.64.0708151736150.5158@anakin> |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| References: | <20070815112507.GB17615@hall.aurel32.net> <Pine.LNX.4.64.0708151736150.5158@anakin> |
| Sender: | linux-mips-bounce@linux-mips.org |
On Wed, 15 Aug 2007, Geert Uytterhoeven wrote:
> On Wed, 15 Aug 2007, Aurelien Jarno wrote:
> > --- a/arch/mips/bcm947xx/wgt634u.c
> > +++ b/arch/mips/bcm947xx/wgt634u.c
>
> > +static const struct gpio_led wgt634u_leds[] = {
>
> > +static const struct gpio_led_platform_data wgt634u_led_data = {
> > + .num_leds = ARRAY_SIZE(wgt634u_leds),
> > + .leds = (void *) wgt634u_leds,
> ^^^^^^^^
>
> gpio_led_platform_data.leds is of type struct gpio_led *.
> Should it be const, or should the const be dropped from wgt634u_leds?
>
> > +static struct platform_device wgt634u_gpio_leds = {
> > + .name = "leds-gpio",
> > + .id = -1,
> > + .dev = {
> > + .platform_data = (void *) &wgt634u_led_data,
> ^^^^^^^^
> device.platform_data is a void *, so you can drop the cast.
Hmm, wgt634u_led_data is const too. But casting away constness is
usually an indicator that something is wrong.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH -mm][MIPS] GPIO LED driver for the WGT634U machine, Geert Uytterhoeven |
|---|---|
| Next by Date: | Re: [PATCH -mm][MIPS] GPIO LED driver for the WGT634U machine, Aurelien Jarno |
| Previous by Thread: | Re: [PATCH -mm][MIPS] GPIO LED driver for the WGT634U machine, Geert Uytterhoeven |
| Next by Thread: | Re: [PATCH -mm][MIPS] GPIO LED driver for the WGT634U machine, Aurelien Jarno |
| Indexes: | [Date] [Thread] [Top] [All Lists] |