mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 00:43:12 +00:00
gpio: Enable nonexclusive gpiods from DT nodes
This makes gpiod_get_from_of_node() respect the
GPIOD_FLAGS_BIT_NONEXCLUSIVE flag which is especially
nice when getting regulator GPIOs right out of device
tree nodes.
Suggested-by: Marek Szyprowski <[email protected]>
Fixes: b0ce7b29bf ("regulator/gpio: Allow nonexclusive GPIO access")
Signed-off-by: Linus Walleij <[email protected]>
Reviewed-by: Marek Szyprowski <[email protected]>
Tested-by: Marek Szyprowski <[email protected]>
Reviewed-by: Charles Keepax <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
@@ -4204,6 +4204,8 @@ struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
|
||||
transitory = flags & OF_GPIO_TRANSITORY;
|
||||
|
||||
ret = gpiod_request(desc, label);
|
||||
if (ret == -EBUSY && (flags & GPIOD_FLAGS_BIT_NONEXCLUSIVE))
|
||||
return desc;
|
||||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user