Skip to contentSkip to conversation

gpio: shared: ignore disabled nodes when traversing the device-tree

PATCH Applied Bartosz Golaszewski 1 participant 2 messages Dec 3, 2025 – Dec 9, 2025 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/gpio/gpiolib-shared.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpio/gpiolib-shared.c +4 -0
index 8bdd107b1ad1..5d15675d61ea 100644
@@ -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.
Signature · 1 line
2.51.0
author Applied
#1 lore raw
Quoted 5 lines · Bartosz Golaszewski

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.

Applied, thanks!

[1/1] gpio: shared: ignore disabled nodes when traversing the device-tree

      https://git.kernel.org/brgl/linux/c/9e7a40a2841483d7bf51b8d9a5e1f0633a5c7a26

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>