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 <m.szyprowski@samsung.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Robert Marko <robimarko@gmail.com> Tested-by: Andrew Halaney <ahalaney@redhat.com> Reviewed-by: Brian Masney <bmasney@redhat.com> Tested-by: Brian Masney <bmasney@redhat.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent a431803 commit ddf07bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)