aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-11-06 08:49:39 -0500
committerLinus Walleij <linus.walleij@linaro.org>2012-11-11 13:06:04 -0500
commit165adc9c1734a3f3bdbc6dc7c7a29bbefb424006 (patch)
tree3da612f7408e59d9956886952e118e4fd977ef20 /drivers/gpio
parent33dfc41461b77e2b38673ec1b5622b1d9340324d (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 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index f0b07bbfcc9a..1e1a7cabc57e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1185,6 +1185,7 @@ struct gpio_chip *gpiochip_find(void *data,
1185EXPORT_SYMBOL_GPL(gpiochip_find); 1185EXPORT_SYMBOL_GPL(gpiochip_find);
1186 1186
1187#ifdef CONFIG_PINCTRL 1187#ifdef CONFIG_PINCTRL
1188
1188void gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, 1189void gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
1189 unsigned int pin_base, unsigned int npins) 1190 unsigned int pin_base, unsigned int npins)
1190{ 1191{
@@ -1206,6 +1207,7 @@ void gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
1206 1207
1207 list_add_tail(&pin_range->node, &chip->pin_ranges); 1208 list_add_tail(&pin_range->node, &chip->pin_ranges);
1208} 1209}
1210EXPORT_SYMBOL_GPL(gpiochip_add_pin_range);
1209 1211
1210void gpiochip_remove_pin_ranges(struct gpio_chip *chip) 1212void gpiochip_remove_pin_ranges(struct gpio_chip *chip)
1211{ 1213{
@@ -1217,11 +1219,9 @@ void gpiochip_remove_pin_ranges(struct gpio_chip *chip)
1217 &pin_range->range); 1219 &pin_range->range);
1218 } 1220 }
1219} 1221}
1220#else 1222EXPORT_SYMBOL_GPL(gpiochip_remove_pin_ranges);
1221void gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, 1223
1222 unsigned int pin_base, unsigned int npins) {} 1224#endif /* CONFIG_PINCTRL */
1223void gpiochip_remove_pin_ranges(struct gpio_chip *chip) {}
1224#endif
1225 1225
1226/* These "optional" allocation calls help prevent drivers from stomping 1226/* These "optional" allocation calls help prevent drivers from stomping
1227 * on each other, and help provide better diagnostics in debugfs. 1227 * on each other, and help provide better diagnostics in debugfs.