Skip to content

Commit 114e594

Browse files
author
Bartosz Golaszewski
committed
gpio: shared: ignore GPIO hogs when traversing the device tree
GPIO hogs have a "gpios" property but it's not a phandle to a remote node - it references the parent GPIO controller. We must not try to parse it as a phandle. Fixes: a060b8c ("gpiolib: implement low-level, shared GPIO support") Reported-by: Cosmin Tanislav <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent cfab6dc commit 114e594

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpio/gpiolib-shared.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ static bool gpio_shared_of_node_ignore(struct device_node *node)
8383
if (of_node_name_eq(node, "__symbols__"))
8484
return true;
8585

86+
/*
87+
* GPIO hogs have a "gpios" property which is not a phandle and can't
88+
* possibly refer to a shared GPIO.
89+
*/
90+
if (of_property_present(node, "gpio-hog"))
91+
return true;
92+
8693
return false;
8794
}
8895

0 commit comments

Comments
 (0)