linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpiolib: Ensure struct gpio is always defined
@ 2011-10-24 13:24 Mark Brown
  2011-10-24 14:04 ` Grant Likely
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2011-10-24 13:24 UTC (permalink / raw)
  To: Grant Likely; +Cc: linux-kernel, patches, Mark Brown

Currently struct gpio is only defined when using gpiolib which makes the
stub gpio_request_array() much less useful in drivers than is ideal as
they can't work with struct gpio.  Since there are no other definitions
in kernel instead make the define always available no matter if gpiolib
is selectable or selected, ensuring that drivers can always use the
type.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

flob
---
 include/asm-generic/gpio.h |   12 ------------
 include/linux/gpio.h       |   22 ++++++++++++----------
 2 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index d494001..d0b6423 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -170,18 +170,6 @@ extern int __gpio_cansleep(unsigned gpio);
 
 extern int __gpio_to_irq(unsigned gpio);
 
-/**
- * struct gpio - a structure describing a GPIO with configuration
- * @gpio:	the GPIO number
- * @flags:	GPIO configuration as specified by GPIOF_*
- * @label:	a literal description string of this GPIO
- */
-struct gpio {
-	unsigned	gpio;
-	unsigned long	flags;
-	const char	*label;
-};
-
 extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
 extern int gpio_request_array(const struct gpio *array, size_t num);
 extern void gpio_free_array(const struct gpio *array, size_t num);
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 17b5a0d..38ac48b 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -14,6 +14,18 @@
 #define GPIOF_OUT_INIT_LOW	(GPIOF_DIR_OUT | GPIOF_INIT_LOW)
 #define GPIOF_OUT_INIT_HIGH	(GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
 
+/**
+ * struct gpio - a structure describing a GPIO with configuration
+ * @gpio:	the GPIO number
+ * @flags:	GPIO configuration as specified by GPIOF_*
+ * @label:	a literal description string of this GPIO
+ */
+struct gpio {
+	unsigned	gpio;
+	unsigned long	flags;
+	const char	*label;
+};
+
 #ifdef CONFIG_GENERIC_GPIO
 #include <asm/gpio.h>
 
@@ -24,18 +36,8 @@
 #include <linux/errno.h>
 
 struct device;
-struct gpio;
 struct gpio_chip;
 
-/*
- * Some platforms don't support the GPIO programming interface.
- *
- * In case some driver uses it anyway (it should normally have
- * depended on GENERIC_GPIO), these routines help the compiler
- * optimize out much GPIO-related code ... or trigger a runtime
- * warning when something is wrongly called.
- */
-
 static inline bool gpio_is_valid(int number)
 {
 	return false;
-- 
1.7.6.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpiolib: Ensure struct gpio is always defined
  2011-10-24 13:24 [PATCH] gpiolib: Ensure struct gpio is always defined Mark Brown
@ 2011-10-24 14:04 ` Grant Likely
  2011-10-24 14:05   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Grant Likely @ 2011-10-24 14:04 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, linux-kernel, patches

On Mon, Oct 24, 2011 at 03:24:10PM +0200, Mark Brown wrote:
> Currently struct gpio is only defined when using gpiolib which makes the
> stub gpio_request_array() much less useful in drivers than is ideal as
> they can't work with struct gpio.  Since there are no other definitions
> in kernel instead make the define always available no matter if gpiolib
> is selectable or selected, ensuring that drivers can always use the
> type.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> 
> flob

Applied, thanks.

What does "flob" mean?

g.

> ---
>  include/asm-generic/gpio.h |   12 ------------
>  include/linux/gpio.h       |   22 ++++++++++++----------
>  2 files changed, 12 insertions(+), 22 deletions(-)
> 
> diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
> index d494001..d0b6423 100644
> --- a/include/asm-generic/gpio.h
> +++ b/include/asm-generic/gpio.h
> @@ -170,18 +170,6 @@ extern int __gpio_cansleep(unsigned gpio);
>  
>  extern int __gpio_to_irq(unsigned gpio);
>  
> -/**
> - * struct gpio - a structure describing a GPIO with configuration
> - * @gpio:	the GPIO number
> - * @flags:	GPIO configuration as specified by GPIOF_*
> - * @label:	a literal description string of this GPIO
> - */
> -struct gpio {
> -	unsigned	gpio;
> -	unsigned long	flags;
> -	const char	*label;
> -};
> -
>  extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
>  extern int gpio_request_array(const struct gpio *array, size_t num);
>  extern void gpio_free_array(const struct gpio *array, size_t num);
> diff --git a/include/linux/gpio.h b/include/linux/gpio.h
> index 17b5a0d..38ac48b 100644
> --- a/include/linux/gpio.h
> +++ b/include/linux/gpio.h
> @@ -14,6 +14,18 @@
>  #define GPIOF_OUT_INIT_LOW	(GPIOF_DIR_OUT | GPIOF_INIT_LOW)
>  #define GPIOF_OUT_INIT_HIGH	(GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
>  
> +/**
> + * struct gpio - a structure describing a GPIO with configuration
> + * @gpio:	the GPIO number
> + * @flags:	GPIO configuration as specified by GPIOF_*
> + * @label:	a literal description string of this GPIO
> + */
> +struct gpio {
> +	unsigned	gpio;
> +	unsigned long	flags;
> +	const char	*label;
> +};
> +
>  #ifdef CONFIG_GENERIC_GPIO
>  #include <asm/gpio.h>
>  
> @@ -24,18 +36,8 @@
>  #include <linux/errno.h>
>  
>  struct device;
> -struct gpio;
>  struct gpio_chip;
>  
> -/*
> - * Some platforms don't support the GPIO programming interface.
> - *
> - * In case some driver uses it anyway (it should normally have
> - * depended on GENERIC_GPIO), these routines help the compiler
> - * optimize out much GPIO-related code ... or trigger a runtime
> - * warning when something is wrongly called.
> - */
> -
>  static inline bool gpio_is_valid(int number)
>  {
>  	return false;
> -- 
> 1.7.6.3
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpiolib: Ensure struct gpio is always defined
  2011-10-24 14:04 ` Grant Likely
@ 2011-10-24 14:05   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2011-10-24 14:05 UTC (permalink / raw)
  To: Grant Likely; +Cc: Grant Likely, linux-kernel, patches

On Mon, Oct 24, 2011 at 04:04:21PM +0200, Grant Likely wrote:

> What does "flob" mean?

It means "I should have deleted this non-empty changelog I wrote so I
could squash down the commit.".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-24 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24 13:24 [PATCH] gpiolib: Ensure struct gpio is always defined Mark Brown
2011-10-24 14:04 ` Grant Likely
2011-10-24 14:05   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).