Skip to content

Commit

Permalink
gpiolib: Add !CONFIG_GPIOLIB definitions of devm_ functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Grant Likely committed Apr 6, 2012
1 parent f5f9311 commit 2c96922
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/linux/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ static inline int gpio_request(unsigned gpio, const char *label)
return -ENOSYS;
}

static inline int devm_gpio_request(struct device *dev, unsigned gpio,
const char *label)
{
return -ENOSYS;
}

static inline int gpio_request_one(unsigned gpio,
unsigned long flags, const char *label)
{
Expand All @@ -79,6 +85,14 @@ static inline void gpio_free(unsigned gpio)
WARN_ON(1);
}

static inline void devm_gpio_free(struct device *dev, unsigned gpio)
{
might_sleep();

/* GPIO can never have been requested */
WARN_ON(1);
}

static inline void gpio_free_array(const struct gpio *array, size_t num)
{
might_sleep();
Expand Down

0 comments on commit 2c96922

Please sign in to comment.