gpio: include <linux/gpio.h> not <asm/gpio.h>
PATCH 1/1 gpio: include <linux/gpio.h> not <asm/gpio.h>
Drivers should be including <linux/gpio.h> not <asm/gpio.h>.
---
drivers/gpio/bt8xxgpio.c +1 -2
@@ -46,8 +46,7 @@#include <linux/module.h> #include <linux/pci.h> #include <linux/spinlock.h> - -#include <asm/gpio.h> +#include <linux/gpio.h> /* Steal the hardware definitions from the bttv driver. */ #include "../media/video/bt8xx/bt848.h"
drivers/gpio/mcp23s08.c +1 -3
@@ -6,12 +6,10 @@#include <linux/device.h> #include <linux/workqueue.h> #include <linux/mutex.h> - +#include <linux/gpio.h> #include <linux/spi/spi.h> #include <linux/spi/mcp23s08.h> -#include <asm/gpio.h> -/* Registers are all 8 bits wide. *
drivers/gpio/pca953x.c +1 -2
@@ -13,6 +13,7 @@#include <linux/module.h> #include <linux/init.h> +#include <linux/gpio.h> #include <linux/i2c.h> #include <linux/i2c/pca953x.h> #ifdef CONFIG_OF_GPIO
@@ -20,8 +21,6 @@#include <linux/of_gpio.h> #endif -#include <asm/gpio.h> -#define PCA953X_INPUT 0#define PCA953X_OUTPUT 1#define PCA953X_INVERT 2
drivers/gpio/pcf857x.c +1 -2
@@ -20,11 +20,10 @@#include <linux/kernel.h> #include <linux/slab.h> +#include <linux/gpio.h> #include <linux/i2c.h> #include <linux/i2c/pcf857x.h> -#include <asm/gpio.h> -static const struct i2c_device_id pcf857x_id[] = { {"pcf8574" ,8 },
Quoted 11 lines · On Fri, 31 Jul 2009 10:59:50 -0700 H Hartley Sweeten…
Drivers should be including <
linux/gpio.h> not <asm/gpio.h>.Signed-off-by H Hartley Sweeten <[email protected]>---
drivers/gpio/bt8xxgpio.c +0
-0
drivers/gpio/bt8xxgpio.c line 49
Quoted 6 lines
drivers/gpio/bt8xxgpio.c +1
-2@@ -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 ;)
Quoted 27 lines · Andrew Morton
Quoted 11 lines
Drivers should be including <
linux/gpio.h> not <asm/gpio.h>.Signed-off-by H Hartley Sweeten <[email protected]>---
drivers/gpio/bt8xxgpio.c +0
-0drivers/gpio/bt8xxgpio.c line 49
Quoted 6 lines
drivers/gpio/bt8xxgpio.c +1
-2@@ -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.hhas#ifdef
CONFIG_GENERIC_GPIO
#include <asm/gpio.h>#else
...
Quoted 8 lines
#endif
So if there's some configuration which forgot to set
CONFIG_GENERIC_GPIO, the driver will be switched over to use theinclude/linux/gpio.hstubs 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
Quoted 1 line · H Hartley Sweeten
Drivers should be including <
linux/gpio.h> not <asm/gpio.h>.
True. But for the record, that's the "new" way, which is intentionally compatibe wit the "old way". :)