gpiolib: acpi: make fwnode take precedence in struct gpio_chip
Subsystems (3)
PATCH 1/2 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").
--- drivers/gpio/gpiolib-acpi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpio/gpiolib-acpi.c +3 -0
@@ -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)
Signature · 1 line
2.34.1
PATCH 2/2 gpio: dwapb: Switch to use fwnode instead of of_node
GPIO library now accepts fwnode as a firmware node, so switch the driver to use it and hence rectify the ACPI case which uses software nodes.
Note, in this case it's rather logical fix that doesn't affect functionality, thus no backporting required.
--- drivers/gpio/gpio-dwapb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/gpio/gpio-dwapb.c +1 -4
@@ -15,7 +15,6 @@#include <linux/irq.h> #include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/of.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/reset.h>
@@ -515,9 +514,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,return err; } -#ifdef CONFIG_OF_GPIO - port->gc.of_node =to_of_node (pp->fwnode); -#endif + port->gc.fwnode = pp->fwnode; port->gc.ngpio = pp->ngpio; port->gc.base = pp->gpio_base;
Signature · 1 line
2.34.1
Re: [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node
Quoted 6 lines · Andy Shevchenko
GPIO library now accepts fwnode as a firmware node, so switch the driver to use it and hence rectify the ACPI case which uses software nodes.
Note, in this case it's rather logical fix that doesn't affect functionality, thus no backporting required.
Thanks for the patch.
-Sergey
Quoted 32 lines
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/gpio/gpio-dwapb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/gpio/gpio-dwapb.c +1
-4@@ -15,7 +15,6 @@#include <linux/irq.h> #include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/of.h> #include <linux/platform_device.h> #include <linux/property.h> #include <linux/reset.h> @@ -515,9 +514,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,return err; } -#ifdef CONFIG_OF_GPIO - port->gc.of_node =to_of_node (pp->fwnode); -#endif + port->gc.fwnode = pp->fwnode; port->gc.ngpio = pp->ngpio; port->gc.base = pp->gpio_base;Signature · 1 line
2.34.1
Bartosz Golaszewski
AppliedRe: [PATCH v1 2/2] gpio: dwapb: Switch to use fwnode instead of of_node
In reply to Andy ShevchenkoQuoted 10 lines · Andy Shevchenko
GPIO library now accepts fwnode as a firmware node, so switch the driver to use it and hence rectify the ACPI case which uses software nodes.
Note, in this case it's rather logical fix that doesn't affect functionality, thus no backporting required.
Signed-off-by Andy Shevchenko <[email protected]>---
Applied, thanks!
Bart
Quoted 7 lines · Andy Shevchenko
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 structgpio_chip").Signed-off-by Andy Shevchenko <[email protected]>
Bartosz Golaszewski
AppliedQuoted 9 lines · Andy Shevchenko
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 structgpio_chip").Signed-off-by Andy Shevchenko <[email protected]>---
Applied, thanks!
Bart