提交 ddf07bd8 编写于 作者: T Thierry Reding 提交者: Bartosz Golaszewski

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: 8afe8255 ("gpiolib: of: Prepare of_gpiochip_add() / of_gpiochip_remove() for fwnode")
Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: NThierry Reding <treding@nvidia.com>
Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
Tested-by: NRobert Marko <robimarko@gmail.com>
Tested-by: NAndrew Halaney <ahalaney@redhat.com>
Reviewed-by: NBrian Masney <bmasney@redhat.com>
Tested-by: NBrian Masney <bmasney@redhat.com>
Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: NBartosz Golaszewski <bartosz.golaszewski@linaro.org>
上级 a4318038
...@@ -1063,7 +1063,7 @@ int of_gpiochip_add(struct gpio_chip *chip) ...@@ -1063,7 +1063,7 @@ int of_gpiochip_add(struct gpio_chip *chip)
struct device_node *np; struct device_node *np;
int ret; int ret;
np = to_of_node(chip->fwnode); np = to_of_node(dev_fwnode(&chip->gpiodev->dev));
if (!np) if (!np)
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册