Re: [PATCH 1/2] leds-tca6507: allow driver to compile when GPIOLIBis not available.

From: NeilBrown
Date: Tue Dec 20 2011 - 00:38:09 EST


On Mon, 19 Dec 2011 12:34:18 -0800 Randy Dunlap <rdunlap@xxxxxxxxxxxx> wrote:

> On 12/18/2011 04:20 PM, NeilBrown wrote:
> > This driver can configure the outputs as GPIO line instead of LEDs. But
> > that only works if GPIOLIB is available. So make that code conditional
> > on the library's availability.
> >
> > Also remove the 'teardown' callback as it is never called and should
> > never be needed.
> >
> > Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxx>,
> > Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>,
> > Signed-off-by: NeilBrown <neilb@xxxxxxx>
>
> Hi Neil,
>
> with linux-next 20111219 and this patch applied, I now get:
>
> drivers/leds/leds-tca6507.c: In function 'tca6507_remove':
> drivers/leds/leds-tca6507.c:677:9: error: 'struct tca6507_chip' has no member named 'gpio'
> drivers/leds/leds-tca6507.c:678:3: error: implicit declaration of function 'gpiochip_remove'
> drivers/leds/leds-tca6507.c:678:33: error: 'struct tca6507_chip' has no member named 'gpio'
>
> when GPIOLIB is not enabled.

Drat - I forgot the 'remove' code.

I cannot easily compile for an ARCH that doesn't include GPIOLIB, but it
seems that if I put
#undef CONFIG_GPIOLIB
at the top of leds-tca6507.c it comes close enough for testing.
So the next version should get that right. I'll repost.

Thanks,
NeilBrown


Attachment: signature.asc
Description: PGP signature