]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpiolib: acpi: make fwnode take precedence in struct gpio_chip
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 23 Dec 2021 10:38:08 +0000 (12:38 +0200)
committerBartosz Golaszewski <brgl@bgdev.pl>
Mon, 3 Jan 2022 10:06:15 +0000 (11:06 +0100)
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 <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpiolib-acpi.c

index c7a0e56593e77974a79e21d006f137c3e7af98b6..c0f6a25c327944b26489f24f72ac41a768291a9b 100644 (file)
@@ -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)