diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2025-12-03 10:23:09 +0100 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2025-12-09 07:14:53 +0100 |
| commit | 9e7a40a2841483d7bf51b8d9a5e1f0633a5c7a26 (patch) | |
| tree | b6e613581efd7ed866da8fc5327dd27dee14c43c | |
| parent | 2d967310c49ed93ac11cef408a55ddf15c3dd52e (diff) | |
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: a060b8c511ab ("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>
| -rw-r--r-- | drivers/gpio/gpiolib-shared.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c index 8bdd107b1ad1..5d15675d61ea 100644 --- a/drivers/gpio/gpiolib-shared.c +++ b/drivers/gpio/gpiolib-shared.c @@ -77,6 +77,10 @@ gpio_shared_find_entry(struct fwnode_handle *controller_node, /* Handle all special nodes that we should ignore. */ static bool gpio_shared_of_node_ignore(struct device_node *node) { + /* Ignore disabled devices. */ + if (!of_device_is_available(node)) + return true; + /* * __symbols__ is a special, internal node and should not be considered * when scanning for shared GPIOs. |
