From: Andy Shevchenko Date: Thu, 23 Dec 2021 10:38:08 +0000 (+0200) Subject: gpiolib: acpi: make fwnode take precedence in struct gpio_chip X-Git-Tag: v5.17-rc1~142^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a08d63c243ae8525c40016ce57b50df515fafaf;p=thirdparty%2Fkernel%2Flinux.git gpiolib: acpi: make fwnode take precedence in struct gpio_chip If the driver sets the fwnode in struct gpio_chip, let it take precedence over the parent's fwnode. This is a follow up to the commit 9126a738edc1 ("gpiolib: of: make fwnode take precedence in struct gpio_chip"). Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index c7a0e56593e77..c0f6a25c32794 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -1339,6 +1339,9 @@ void acpi_gpio_dev_init(struct gpio_chip *gc, struct gpio_device *gdev) /* Set default fwnode to parent's one if present */ if (gc->parent) ACPI_COMPANION_SET(&gdev->dev, ACPI_COMPANION(gc->parent)); + + if (gc->fwnode) + device_set_node(&gdev->dev, gc->fwnode); } static int acpi_gpio_package_count(const union acpi_object *obj)