RE: [PATCH] gpio: include <linux/gpio.h> not <asm/gpio.h>

From: H Hartley Sweeten
Date: Mon Aug 03 2009 - 18:17:39 EST


On Monday, August 03, 2009 2:51 PM, Andrew Morton wrote:
>> Drivers should be including <linux/gpio.h> not <asm/gpio.h>.
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
>>
>> ---
>>
>> diff --git a/drivers/gpio/bt8xxgpio.c b/drivers/gpio/bt8xxgpio.c
>> index 984b587..fd1c54d 100644
>> --- a/drivers/gpio/bt8xxgpio.c
>> +++ b/drivers/gpio/bt8xxgpio.c
>> @@ -46,8 +46,7 @@
>> #include <linux/module.h>
>> #include <linux/pci.h>
>> #include <linux/spinlock.h>
>> -
>> -#include <asm/gpio.h>
>> +#include <linux/gpio.h>
>
> There's some potential for breakage here. include/linux/gpio.h has
>
> #ifdef CONFIG_GENERIC_GPIO
> #include <asm/gpio.h>
>
> #else
>
> ...
>
> #endif
>
>
> So if there's some configuration which forgot to set
> CONFIG_GENERIC_GPIO, the driver will be switched over to use the
> include/linux/gpio.h stubs and will break.
>
> Please convince me that this cannot happen ;)

Can't happen for these drivers. Everything in drivers/gpio requires
GPIOLIB which selects GENERIC_GPIO. Please see drivers/gpio/Kconfig.

Thanks,
Hartley


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/