gpio: fix getting nonexclusive gpiods from DT
Subsystems (2)
PATCH 1/1 gpio: fix getting nonexclusive gpiods from DT
From: Marco Felsch <[email protected]>
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.
--- drivers/gpio/gpiolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpiolib.c +1 -1
@@ -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);
Signature · 1 line
2.23.0
Quoted 9 lines · Bartosz Golaszewski
From: Marco Felsch <[email protected]>
Since commit
ec757001c818("gpio: Enable nonexclusive gpiods from DT nodes") we are able to getGPIOD_FLAGS_BIT_NONEXCLUSIVEmarked gpios. Currently the gpiolib uses the wrong flags variable for the check. We need to check thegpiod_flagsinstead of theof_gpio_flagselse we return-EBUSYforGPIOD_FLAGS_BIT_NONEXCLUSIVEmarked and requested gpiod's.
Quoted 7 lines
Fixes ec757001c818 gpio: Enable nonexclusive gpiods from DT nodesSigned-off-by Marco Felsch <[email protected]>[Bartosz: the function was moved to gpiolib-of.c so updated the patch]Signed-off-by Bartosz Golaszewski <[email protected]>[Bartosz: backported to v5.3.y]Signed-off-by Bartosz Golaszewski <[email protected]>
Queued this one for 5.3, thanks!
Signature · 2 lines
Thanks, Sasha
Quoted 9 lines · Bartosz Golaszewski
From: Marco Felsch <[email protected]>
Since commit
ec757001c818("gpio: Enable nonexclusive gpiods from DT nodes") we are able to getGPIOD_FLAGS_BIT_NONEXCLUSIVEmarked gpios. Currently the gpiolib uses the wrong flags variable for the check. We need to check thegpiod_flagsinstead of theof_gpio_flagselse we return-EBUSYforGPIOD_FLAGS_BIT_NONEXCLUSIVEmarked and requested gpiod's.
Quoted 7 lines
Fixes ec757001c818 gpio: Enable nonexclusive gpiods from DT nodesSigned-off-by Marco Felsch <[email protected]>[Bartosz: the function was moved to gpiolib-of.c so updated the patch]Signed-off-by Bartosz Golaszewski <[email protected]>[Bartosz: backported to v5.3.y]Signed-off-by Bartosz Golaszewski <[email protected]>
Thanks for fixing up this backport Bartosz, much appreciated!
Yours,
Linus Walleij