diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-02 07:46:46 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-05-18 18:48:35 -0400 |
commit | 09d71ff19404b3957fab6de942fb8026ccfd8524 (patch) | |
tree | ba3680f5b79ea1fbeae073ab7cb28c9bdcad7e60 /include/linux/gpio.h | |
parent | eb1567f7ad0032ba7b02b878e352f191d53dc228 (diff) |
gpiolib: Implement devm_gpio_request_one()
Allow drivers to use the modern request and configure idiom together
with devres.
As with plain gpio_request() and gpio_request_one() we can't implement
the old school version in terms of _one() as this would force the
explicit selection of a direction in gpio_request() which could break
systems if we pick the wrong one. Implementing devm_gpio_request_one()
in terms of devm_gpio_request() would needlessly complicate things or
lead to duplication from the unmanaged version depending on how it's
done.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r-- | include/linux/gpio.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 7a8816a1a0d8..f07fc2d08159 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -106,6 +106,12 @@ static inline int gpio_request_one(unsigned gpio, | |||
106 | return -ENOSYS; | 106 | return -ENOSYS; |
107 | } | 107 | } |
108 | 108 | ||
109 | static inline int devm_gpio_request_one(struct device *dev, unsigned gpio, | ||
110 | unsigned long flags, const char *label) | ||
111 | { | ||
112 | return -ENOSYS; | ||
113 | } | ||
114 | |||
109 | static inline int gpio_request_array(const struct gpio *array, size_t num) | 115 | static inline int gpio_request_array(const struct gpio *array, size_t num) |
110 | { | 116 | { |
111 | return -ENOSYS; | 117 | return -ENOSYS; |