diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-11-06 08:49:39 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-11-11 13:06:04 -0500 |
commit | 165adc9c1734a3f3bdbc6dc7c7a29bbefb424006 (patch) | |
tree | 3da612f7408e59d9956886952e118e4fd977ef20 /include/linux/gpio.h | |
parent | 33dfc41461b77e2b38673ec1b5622b1d9340324d (diff) |
gpiolib: fix up function prototypes etc
Commit 69e1601bca88809dc118abd1becb02c15a02ec71
"gpiolib: provide provision to register pin ranges"
Got most of it's function prototypes wrong, so fix this up by:
- Moving the void declarations into static inlines in
<linux/gpio.h> (previously the actual prototypes were declared
here...)
- Declare the gpiochip_add_pin_range() and
gpiochip_remove_pin_ranges() functions in <asm-generic/gpio.h>
together with the pin range struct declaration itself.
- Actually only implement these very functions in gpiolib.c
if CONFIG_PINCTRL is set.
- Additionally export the symbols since modules will need to
be able to do this.
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r-- | include/linux/gpio.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index a28445992b7f..21d28b930dc7 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -72,9 +72,9 @@ static inline int irq_to_gpio(unsigned int irq) | |||
72 | return -EINVAL; | 72 | return -EINVAL; |
73 | } | 73 | } |
74 | 74 | ||
75 | #endif | 75 | #endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */ |
76 | 76 | ||
77 | #else | 77 | #else /* ! CONFIG_GENERIC_GPIO */ |
78 | 78 | ||
79 | #include <linux/kernel.h> | 79 | #include <linux/kernel.h> |
80 | #include <linux/types.h> | 80 | #include <linux/types.h> |
@@ -231,9 +231,21 @@ static inline int irq_to_gpio(unsigned irq) | |||
231 | return -EINVAL; | 231 | return -EINVAL; |
232 | } | 232 | } |
233 | 233 | ||
234 | void gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, | 234 | #ifdef CONFIG_PINCTRL |
235 | unsigned int pin_base, unsigned int npins); | 235 | |
236 | void gpiochip_remove_pin_ranges(struct gpio_chip *chip); | 236 | static inline void |
237 | #endif | 237 | gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, |
238 | unsigned int pin_base, unsigned int npins) | ||
239 | { | ||
240 | } | ||
241 | |||
242 | static inline void | ||
243 | gpiochip_remove_pin_ranges(struct gpio_chip *chip) | ||
244 | { | ||
245 | } | ||
246 | |||
247 | #endif /* CONFIG_PINCTRL */ | ||
248 | |||
249 | #endif /* ! CONFIG_GENERIC_GPIO */ | ||
238 | 250 | ||
239 | #endif /* __LINUX_GPIO_H */ | 251 | #endif /* __LINUX_GPIO_H */ |