Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c96922a authored by Mark Brown's avatar Mark Brown Committed by Grant Likely
Browse files

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent f5f93117
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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)
{
@@ -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();