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>
This commit is contained in:
parent
eb1567f7ad
commit
09d71ff194
3 changed files with 37 additions and 0 deletions
|
@ -106,6 +106,12 @@ static inline int gpio_request_one(unsigned gpio,
|
|||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int devm_gpio_request_one(struct device *dev, unsigned gpio,
|
||||
unsigned long flags, const char *label)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int gpio_request_array(const struct gpio *array, size_t num)
|
||||
{
|
||||
return -ENOSYS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue