summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-of.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2022-11-11 14:37:32 +0300
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2022-11-15 17:38:18 +0300
commitddf07bd874be791a63fca5ac0e3def1e15f2338f (patch)
tree8c1551a35a924b376288b6d57024410a81b7592e /drivers/gpio/gpiolib-of.c
parenta431803852de00d8d3c143b19f5690254225538f (diff)
downloadlinux-ddf07bd874be791a63fca5ac0e3def1e15f2338f.tar.xz
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: 8afe82550240 ("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>
Diffstat (limited to 'drivers/gpio/gpiolib-of.c')
-rw-r--r--drivers/gpio/gpiolib-of.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index a6871859a59d..4fff7258ee41 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -1063,7 +1063,7 @@ int of_gpiochip_add(struct gpio_chip *chip)
struct device_node *np;
int ret;
- np = to_of_node(chip->fwnode);
+ np = to_of_node(dev_fwnode(&chip->gpiodev->dev));
if (!np)
return 0;