linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: expose gpio_to_chip()
@ 2011-06-10  8:49 Linus Walleij
  2011-06-10 15:57 ` H Hartley Sweeten
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2011-06-10  8:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Linus Walleij <linus.walleij@linaro.org>

This makes the gpio_to_chip() function available to drivers. The
usecase is when you want to add a few chip-specific operations
apart from the ones exposed in struct gpio_chip.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpiolib.c     |    2 +-
 include/asm-generic/gpio.h |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index a971e3d..dc315e9 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -114,7 +114,7 @@ static int gpio_ensure_requested(struct gpio_desc *desc, unsigned offset)
 }
 
 /* caller holds gpio_lock *OR* gpio is marked as requested */
-static inline struct gpio_chip *gpio_to_chip(unsigned gpio)
+struct gpio_chip *gpio_to_chip(unsigned gpio)
 {
 	return gpio_desc[gpio].chip;
 }
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index fcdcb5d..dd8c815 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -132,6 +132,7 @@ struct gpio_chip {
 #endif
 };
 
+extern struct gpio_chip *gpio_to_chip(unsigned gpio);
 extern const char *gpiochip_is_requested(struct gpio_chip *chip,
 			unsigned offset);
 extern int __must_check gpiochip_reserve(int start, int ngpio);
-- 
1.7.3.2

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

* [PATCH 1/2] gpio: expose gpio_to_chip()
  2011-06-10  8:49 [PATCH 1/2] gpio: expose gpio_to_chip() Linus Walleij
@ 2011-06-10 15:57 ` H Hartley Sweeten
  2011-06-13  8:43   ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: H Hartley Sweeten @ 2011-06-10 15:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday, June 10, 2011 1:49 AM, Linus Walleij wrote:
>
> This makes the gpio_to_chip() function available to drivers. The
> usecase is when you want to add a few chip-specific operations
> apart from the ones exposed in struct gpio_chip.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/gpio/gpiolib.c     |    2 +-
>  include/asm-generic/gpio.h |    1 +
>  2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index a971e3d..dc315e9 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -114,7 +114,7 @@ static int gpio_ensure_requested(struct gpio_desc *desc, unsigned offset)
>  }
> 
>  /* caller holds gpio_lock *OR* gpio is marked as requested */
> -static inline struct gpio_chip *gpio_to_chip(unsigned gpio)
> +struct gpio_chip *gpio_to_chip(unsigned gpio)
>  {
>  	return gpio_desc[gpio].chip;
>  }
> diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
> index fcdcb5d..dd8c815 100644
> --- a/include/asm-generic/gpio.h
> +++ b/include/asm-generic/gpio.h
> @@ -132,6 +132,7 @@ struct gpio_chip {
>  #endif
>  };
> 
> +extern struct gpio_chip *gpio_to_chip(unsigned gpio);
>  extern const char *gpiochip_is_requested(struct gpio_chip *chip,
> 			unsigned offset);
>  extern int __must_check gpiochip_reserve(int start, int ngpio);

Linus,

You'll need to fix a couple drivers for this to work.  The symbol gpio_to_chip
is a static symbol in a couple places other than gpiolib.c.


arch/arm/plat-pxa/gpio.c:static inline struct pxa_gpio_chip *gpio_to_chip(unsigned gpio)
drivers/gpio/gpio-74x164.c:static struct gen_74x164_chip *gpio_to_chip(struct gpio_chip *gc)

Regards,
Hartley

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

* [PATCH 1/2] gpio: expose gpio_to_chip()
  2011-06-10 15:57 ` H Hartley Sweeten
@ 2011-06-13  8:43   ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2011-06-13  8:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jun 10, 2011 at 5:57 PM, H Hartley Sweeten
<hartleys@visionengravers.com> wrote:
> On Friday, June 10, 2011 1:49 AM, Linus Walleij wrote:

>> This makes the gpio_to_chip() function available to drivers. The
>> usecase is when you want to add a few chip-specific operations
>> apart from the ones exposed in struct gpio_chip.
> (...)
>
> Linus,
>
> You'll need to fix a couple drivers for this to work. ?The symbol gpio_to_chip
> is a static symbol in a couple places other than gpiolib.c.

OK I fix! They are confusing anyway so should be patched pronto.

Linus Walleij

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

end of thread, other threads:[~2011-06-13  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10  8:49 [PATCH 1/2] gpio: expose gpio_to_chip() Linus Walleij
2011-06-10 15:57 ` H Hartley Sweeten
2011-06-13  8:43   ` Linus Walleij

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).