1 From 76870d237adff4c8e419064e7d4f5a8ef87c1085 Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Thu, 6 Dec 2018 13:43:44 +0100
4 Subject: [PATCH 803/806] gpio: Enable nonexclusive gpiods from DT nodes
6 commit ec757001c818c175e6b610e8ef80c2a25d1ed1a5 upstream.
8 This makes gpiod_get_from_of_node() respect the
9 GPIOD_FLAGS_BIT_NONEXCLUSIVE flag which is especially
10 nice when getting regulator GPIOs right out of device
13 Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
14 Fixes: b0ce7b29bfcd ("regulator/gpio: Allow nonexclusive GPIO access")
15 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
16 Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
17 Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
18 Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
19 Signed-off-by: Mark Brown <broonie@kernel.org>
21 drivers/gpio/gpiolib.c | 2 ++
22 1 file changed, 2 insertions(+)
24 --- a/drivers/gpio/gpiolib.c
25 +++ b/drivers/gpio/gpiolib.c
26 @@ -4033,6 +4033,8 @@ struct gpio_desc *gpiod_get_from_of_node
27 transitory = flags & OF_GPIO_TRANSITORY;
29 ret = gpiod_request(desc, label);
30 + if (ret == -EBUSY && (flags & GPIOD_FLAGS_BIT_NONEXCLUSIVE))