Skip to content

Commit 9e7a40a

Browse files
author
Bartosz Golaszewski
committed
gpio: shared: ignore disabled nodes when traversing the device-tree
Don't consider disabled devices when traversing the device-tree looking for shared GPIOs. Even if they do share a phandle to a pin, they can never be instantiated and request it. Fixes: a060b8c ("gpiolib: implement low-level, shared GPIO support") Link: https://lore.kernel.org/r/20251203092309.34737-1-bartosz.golaszewski@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
1 parent 2d96731 commit 9e7a40a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/gpio/gpiolib-shared.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ gpio_shared_find_entry(struct fwnode_handle *controller_node,
7777
/* Handle all special nodes that we should ignore. */
7878
static bool gpio_shared_of_node_ignore(struct device_node *node)
7979
{
80+
/* Ignore disabled devices. */
81+
if (!of_device_is_available(node))
82+
return true;
83+
8084
/*
8185
* __symbols__ is a special, internal node and should not be considered
8286
* when scanning for shared GPIOs.

0 commit comments

Comments
 (0)