Commit 59a4a351 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski

gpiolib: of: Don't use GPIO chip fwnode in of_gpiochip_*()

GPIO library should rely only on the GPIO device's fwnode.
Hence, replace GPIO chip fwnode usage by respective OF node
of the GPIO device.

JFYI, this is partial revert of 8afe8255 ("gpiolib: of:
Prepare of_gpiochip_add() / of_gpiochip_remove() for fwnode").
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 3283d820
...@@ -1078,16 +1078,16 @@ int of_gpiochip_add(struct gpio_chip *chip) ...@@ -1078,16 +1078,16 @@ int of_gpiochip_add(struct gpio_chip *chip)
if (ret) if (ret)
return ret; return ret;
fwnode_handle_get(chip->fwnode); of_node_get(np);
ret = of_gpiochip_scan_gpios(chip); ret = of_gpiochip_scan_gpios(chip);
if (ret) if (ret)
fwnode_handle_put(chip->fwnode); of_node_put(np);
return ret; return ret;
} }
void of_gpiochip_remove(struct gpio_chip *chip) void of_gpiochip_remove(struct gpio_chip *chip)
{ {
fwnode_handle_put(chip->fwnode); of_node_put(dev_of_node(&chip->gpiodev->dev));
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment