* [PATCH] gpio: shared: ignore disabled nodes when traversing the device-tree
@ 2025-12-03 9:23 Bartosz Golaszewski
2025-12-09 6:19 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2025-12-03 9:23 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: linux-kernel, linux-gpio, 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.
Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
drivers/gpio/gpiolib-shared.c | 4 ++++
1 file changed, 4 insertions(+)
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.
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] gpio: shared: ignore disabled nodes when traversing the device-tree
2025-12-03 9:23 [PATCH] gpio: shared: ignore disabled nodes when traversing the device-tree Bartosz Golaszewski
@ 2025-12-09 6:19 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2025-12-09 6:19 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Bartosz Golaszewski
Cc: linux-kernel, linux-gpio
On Wed, 03 Dec 2025 10:23:09 +0100, Bartosz Golaszewski wrote:
> 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,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-09 6:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-03 9:23 [PATCH] gpio: shared: ignore disabled nodes when traversing the device-tree Bartosz Golaszewski
2025-12-09 6:19 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®