diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2014-07-24 05:51:02 (GMT) |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-07-24 16:18:47 (GMT) |
commit | c7caf86823c71fae652cc50c7d8dd0d2b5c41229 (patch) | |
tree | 3cb7cf155bf315ffd9b85c641615eb84dfb08150 /include/asm-generic | |
parent | 7fd834ad77f79fe0e8e9840238f18bdc088c97b6 (diff) | |
download | linux-c7caf86823c71fae652cc50c7d8dd0d2b5c41229.tar.xz |
gpio: remove gpio_ensure_requested()
gpio_ensure_requested() has been introduced in Feb. 2008 by commit
d2876d08d86f2 to force users of the GPIO API to explicitly request GPIOs
before using them.
Hopefully by now all GPIOs are correctly requested and this extra check
can be omitted ; in any case the GPIO maintainers won't feel bad if
machines start failing after 6 years of warnings.
This patch removes that function from the dark ages.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/gpio.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 39a1d06..c1d4105 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -63,10 +63,19 @@ static inline struct gpio_chip *gpio_to_chip(unsigned gpio) extern int gpio_request(unsigned gpio, const char *label); extern void gpio_free(unsigned gpio); -extern int gpio_direction_input(unsigned gpio); -extern int gpio_direction_output(unsigned gpio, int value); +static inline int gpio_direction_input(unsigned gpio) +{ + return gpiod_direction_input(gpio_to_desc(gpio)); +} +static inline int gpio_direction_output(unsigned gpio, int value) +{ + return gpiod_direction_output_raw(gpio_to_desc(gpio), value); +} -extern int gpio_set_debounce(unsigned gpio, unsigned debounce); +static inline int gpio_set_debounce(unsigned gpio, unsigned debounce) +{ + return gpiod_set_debounce(gpio_to_desc(gpio), debounce); +} static inline int gpio_get_value_cansleep(unsigned gpio) { |