* [PATCH] gpio: include <linux/gpio.h> not <asm/gpio.h>
@ 2009-07-31 17:59 H Hartley Sweeten
2009-08-03 21:50 ` Andrew Morton
2009-08-04 1:12 ` David Brownell
0 siblings, 2 replies; 4+ messages in thread
From: H Hartley Sweeten @ 2009-07-31 17:59 UTC (permalink / raw)
To: Linux Kernel; +Cc: David Brownell
Drivers should be including <linux/gpio.h> not <asm/gpio.h>.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
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>
/* Steal the hardware definitions from the bttv driver. */
#include "../media/video/bt8xx/bt848.h"
diff --git a/drivers/gpio/mcp23s08.c b/drivers/gpio/mcp23s08.c
index f6fae0e..125f921 100644
--- a/drivers/gpio/mcp23s08.c
+++ b/drivers/gpio/mcp23s08.c
@@ -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.
*
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index cdb6574..8f8fefd 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -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
diff --git a/drivers/gpio/pcf857x.c b/drivers/gpio/pcf857x.c
index 9525724..72f2449 100644
--- a/drivers/gpio/pcf857x.c
+++ b/drivers/gpio/pcf857x.c
@@ -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 },
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: include <linux/gpio.h> not <asm/gpio.h>
2009-07-31 17:59 [PATCH] gpio: include <linux/gpio.h> not <asm/gpio.h> H Hartley Sweeten
@ 2009-08-03 21:50 ` Andrew Morton
2009-08-03 22:17 ` H Hartley Sweeten
2009-08-04 1:12 ` David Brownell
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2009-08-03 21:50 UTC (permalink / raw)
To: H Hartley Sweeten; +Cc: linux-kernel, dbrownell
On Fri, 31 Jul 2009 10:59:50 -0700
H Hartley Sweeten <hartleys@visionengravers.com> wrote:
> Drivers should be including <linux/gpio.h> not <asm/gpio.h>.
>
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>
> ---
>
> 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 ;)
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] gpio: include <linux/gpio.h> not <asm/gpio.h>
2009-08-03 21:50 ` Andrew Morton
@ 2009-08-03 22:17 ` H Hartley Sweeten
0 siblings, 0 replies; 4+ messages in thread
From: H Hartley Sweeten @ 2009-08-03 22:17 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, dbrownell
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@visionengravers.com>
>>
>> ---
>>
>> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpio: include <linux/gpio.h> not <asm/gpio.h>
2009-07-31 17:59 [PATCH] gpio: include <linux/gpio.h> not <asm/gpio.h> H Hartley Sweeten
2009-08-03 21:50 ` Andrew Morton
@ 2009-08-04 1:12 ` David Brownell
1 sibling, 0 replies; 4+ messages in thread
From: David Brownell @ 2009-08-04 1:12 UTC (permalink / raw)
To: H Hartley Sweeten; +Cc: Linux Kernel
On Friday 31 July 2009, H Hartley Sweeten wrote:
> 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". :)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-05 0:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-31 17:59 [PATCH] gpio: include <linux/gpio.h> not <asm/gpio.h> H Hartley Sweeten
2009-08-03 21:50 ` Andrew Morton
2009-08-03 22:17 ` H Hartley Sweeten
2009-08-04 1:12 ` David Brownell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox