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

From: Andrew Morton
Date: Mon Aug 03 2009 - 17:51:17 EST


On Fri, 31 Jul 2009 10:59:50 -0700
H Hartley Sweeten <hartleys@xxxxxxxxxxxxxxxxxxx> 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 ;)
--
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/