]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpiolib: Extend software-node support to support secondary software-nodes
authorHans de Goede <hansg@kernel.org>
Sat, 20 Sep 2025 20:09:55 +0000 (22:09 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 22 Sep 2025 14:23:43 +0000 (16:23 +0200)
commitc6ccc4dde17676dfe617b9a37bd9ba19a8fc87ee
tree7f149457a15bed27a73e3f187ae1e23f5690df36
parent07e27ad16399afcd693be20211b0dfae63e0615f
gpiolib: Extend software-node support to support secondary software-nodes

When a software-node gets added to a device which already has another
fwnode as primary node it will become the secondary fwnode for that
device.

Currently if a software-node with GPIO properties ends up as the secondary
fwnode then gpiod_find_by_fwnode() will fail to find the GPIOs.

Add a new gpiod_fwnode_lookup() helper which falls back to calling
gpiod_find_by_fwnode() with the secondary fwnode if the GPIO was not
found in the primary fwnode.

Fixes: e7f9ff5dc90c ("gpiolib: add support for software nodes")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20250920200955.20403-1-hansg@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib.c