Skip to content

Commit ddf07bd

Browse files
thierryredingBartosz Golaszewski
authored andcommitted
gpiolib: of: Use correct fwnode for DT-probed chips
The OF node store in chip->fwnode is used to explicitly override the FW node for a GPIO chip. For chips that use the default FW node (i.e. that of their parent device), this will be NULL and cause the chip not to be fully registered. Instead, use the GPIO device's FW node, which is set to either the node of the parent device or the explicit override in chip->fwnode. Fixes: 8afe825 ("gpiolib: of: Prepare of_gpiochip_add() / of_gpiochip_remove() for fwnode") Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Tested-by: Robert Marko <[email protected]> Tested-by: Andrew Halaney <[email protected]> Reviewed-by: Brian Masney <[email protected]> Tested-by: Brian Masney <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent a431803 commit ddf07bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpiolib-of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ int of_gpiochip_add(struct gpio_chip *chip)
10631063
struct device_node *np;
10641064
int ret;
10651065

1066-
np = to_of_node(chip->fwnode);
1066+
np = to_of_node(dev_fwnode(&chip->gpiodev->dev));
10671067
if (!np)
10681068
return 0;
10691069

0 commit comments

Comments
 (0)