aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib-swnode.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2025-11-03 10:35:24 +0100
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2025-11-03 15:13:23 +0100
commite5d527be7e6984882306b49c067f1fec18920735 (patch)
tree8350fca4207f571b56788f9620542600931d242a /drivers/gpio/gpiolib-swnode.c
parentdt-bindings: gpio: ti,twl4030: Correct the schema $id path (diff)
downloadlinux-e5d527be7e6984882306b49c067f1fec18920735.tar.gz
linux-e5d527be7e6984882306b49c067f1fec18920735.zip
gpio: swnode: don't use the swnode's name as the key for GPIO lookup
Looking up a GPIO controller by label that is the name of the software node is wonky at best - the GPIO controller driver is free to set a different label than the name of its firmware node. We're already being passed a firmware node handle attached to the GPIO device to swnode_get_gpio_device() so use it instead for a more precise lookup. Acked-by: Linus Walleij <linus.walleij@linaro.org> Fixes: e7f9ff5dc90c ("gpiolib: add support for software nodes") Link: https://lore.kernel.org/r/20251103-reset-gpios-swnodes-v4-4-6461800b6775@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to '')
-rw-r--r--drivers/gpio/gpiolib-swnode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-swnode.c b/drivers/gpio/gpiolib-swnode.c
index f21dbc28cf2c..e3806db1c0e0 100644
--- a/drivers/gpio/gpiolib-swnode.c
+++ b/drivers/gpio/gpiolib-swnode.c
@@ -41,7 +41,7 @@ static struct gpio_device *swnode_get_gpio_device(struct fwnode_handle *fwnode)
!strcmp(gdev_node->name, GPIOLIB_SWNODE_UNDEFINED_NAME))
return ERR_PTR(-ENOENT);
- gdev = gpio_device_find_by_label(gdev_node->name);
+ gdev = gpio_device_find_by_fwnode(fwnode);
return gdev ?: ERR_PTR(-EPROBE_DEFER);
}