diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-04 11:14:48 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-04-06 00:40:32 -0400 |
commit | 2c96922ae3f0bfb7324a7a433d96d319fe6de729 (patch) | |
tree | 86e229aac18a6e294a15c903eb0374abda8041a2 /include/linux/gpio.h | |
parent | f5f93117f4ac24b8493cda67e6a1443517d26845 (diff) |
gpiolib: Add !CONFIG_GPIOLIB definitions of devm_ functions
Currently the managed gpio_request() and gpio_free() are not stubbed out
for configurations not using gpiolib - do that to aid use in drivers.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r-- | include/linux/gpio.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index af511a682925..d1890d46b6ce 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -60,6 +60,12 @@ static inline int gpio_request(unsigned gpio, const char *label) | |||
60 | return -ENOSYS; | 60 | return -ENOSYS; |
61 | } | 61 | } |
62 | 62 | ||
63 | static inline int devm_gpio_request(struct device *dev, unsigned gpio, | ||
64 | const char *label) | ||
65 | { | ||
66 | return -ENOSYS; | ||
67 | } | ||
68 | |||
63 | static inline int gpio_request_one(unsigned gpio, | 69 | static inline int gpio_request_one(unsigned gpio, |
64 | unsigned long flags, const char *label) | 70 | unsigned long flags, const char *label) |
65 | { | 71 | { |
@@ -79,6 +85,14 @@ static inline void gpio_free(unsigned gpio) | |||
79 | WARN_ON(1); | 85 | WARN_ON(1); |
80 | } | 86 | } |
81 | 87 | ||
88 | static inline void devm_gpio_free(struct device *dev, unsigned gpio) | ||
89 | { | ||
90 | might_sleep(); | ||
91 | |||
92 | /* GPIO can never have been requested */ | ||
93 | WARN_ON(1); | ||
94 | } | ||
95 | |||
82 | static inline void gpio_free_array(const struct gpio *array, size_t num) | 96 | static inline void gpio_free_array(const struct gpio *array, size_t num) |
83 | { | 97 | { |
84 | might_sleep(); | 98 | might_sleep(); |