* [PATCH v5.3] gpio: fix getting nonexclusive gpiods from DT
@ 2019-10-14 15:53 Bartosz Golaszewski
2019-10-14 23:35 ` Sasha Levin
2019-10-16 13:06 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2019-10-14 15:53 UTC (permalink / raw)
To: Linus Walleij, Greg Kroah-Hartman
Cc: linux-gpio, stable, Marco Felsch, Bartosz Golaszewski
From: Marco Felsch <m.felsch@pengutronix.de>
Since commit ec757001c818 ("gpio: Enable nonexclusive gpiods from DT
nodes") we are able to get GPIOD_FLAGS_BIT_NONEXCLUSIVE marked gpios.
Currently the gpiolib uses the wrong flags variable for the check. We
need to check the gpiod_flags instead of the of_gpio_flags else we
return -EBUSY for GPIOD_FLAGS_BIT_NONEXCLUSIVE marked and requested
gpiod's.
Fixes: ec757001c818 gpio: Enable nonexclusive gpiods from DT nodes
Cc: stable@vger.kernel.org
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
[Bartosz: the function was moved to gpiolib-of.c so updated the patch]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
[Bartosz: backported to v5.3.y]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
drivers/gpio/gpiolib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index d9074191edef..e4203c1eb869 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4303,7 +4303,7 @@ 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))
+ if (ret == -EBUSY && (dflags & GPIOD_FLAGS_BIT_NONEXCLUSIVE))
return desc;
if (ret)
return ERR_PTR(ret);
--
2.23.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v5.3] gpio: fix getting nonexclusive gpiods from DT
2019-10-14 15:53 [PATCH v5.3] gpio: fix getting nonexclusive gpiods from DT Bartosz Golaszewski
@ 2019-10-14 23:35 ` Sasha Levin
2019-10-16 13:06 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2019-10-14 23:35 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Linus Walleij, Greg Kroah-Hartman, linux-gpio, stable,
Marco Felsch, Bartosz Golaszewski
On Mon, Oct 14, 2019 at 05:53:41PM +0200, Bartosz Golaszewski wrote:
>From: Marco Felsch <m.felsch@pengutronix.de>
>
>Since commit ec757001c818 ("gpio: Enable nonexclusive gpiods from DT
>nodes") we are able to get GPIOD_FLAGS_BIT_NONEXCLUSIVE marked gpios.
>Currently the gpiolib uses the wrong flags variable for the check. We
>need to check the gpiod_flags instead of the of_gpio_flags else we
>return -EBUSY for GPIOD_FLAGS_BIT_NONEXCLUSIVE marked and requested
>gpiod's.
>
>Fixes: ec757001c818 gpio: Enable nonexclusive gpiods from DT nodes
>Cc: stable@vger.kernel.org
>Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
>[Bartosz: the function was moved to gpiolib-of.c so updated the patch]
>Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>[Bartosz: backported to v5.3.y]
>Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Queued this one for 5.3, thanks!
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v5.3] gpio: fix getting nonexclusive gpiods from DT
2019-10-14 15:53 [PATCH v5.3] gpio: fix getting nonexclusive gpiods from DT Bartosz Golaszewski
2019-10-14 23:35 ` Sasha Levin
@ 2019-10-16 13:06 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2019-10-16 13:06 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Greg Kroah-Hartman, open list:GPIO SUBSYSTEM, stable,
Marco Felsch, Bartosz Golaszewski
On Mon, Oct 14, 2019 at 5:53 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> From: Marco Felsch <m.felsch@pengutronix.de>
>
> Since commit ec757001c818 ("gpio: Enable nonexclusive gpiods from DT
> nodes") we are able to get GPIOD_FLAGS_BIT_NONEXCLUSIVE marked gpios.
> Currently the gpiolib uses the wrong flags variable for the check. We
> need to check the gpiod_flags instead of the of_gpio_flags else we
> return -EBUSY for GPIOD_FLAGS_BIT_NONEXCLUSIVE marked and requested
> gpiod's.
>
> Fixes: ec757001c818 gpio: Enable nonexclusive gpiods from DT nodes
> Cc: stable@vger.kernel.org
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> [Bartosz: the function was moved to gpiolib-of.c so updated the patch]
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> [Bartosz: backported to v5.3.y]
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Thanks for fixing up this backport Bartosz, much appreciated!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-16 13:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 15:53 [PATCH v5.3] gpio: fix getting nonexclusive gpiods from DT Bartosz Golaszewski
2019-10-14 23:35 ` Sasha Levin
2019-10-16 13:06 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.