Commit ed6fa21f authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman
Browse files

gpiolib: Extend software-node support to support secondary software-nodes



[ Upstream commit c6ccc4dd ]

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: e7f9ff5d ("gpiolib: add support for software nodes")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarHans de Goede <hansg@kernel.org>
Reviewed-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20250920200955.20403-1-hansg@kernel.org


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
[ Adjust context ]
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 457d2c5e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment