diff mbox series

[v1,2/3] gpiolib: acpi: Don't use GPIO chip fwnode in acpi_gpiochip_find()

Message ID 20230703121838.70898-3-andriy.shevchenko@linux.intel.com
State New
Headers show
Series gpiolib: Avpid modifying GPIO chip fwnode | expand

Commit Message

Andy Shevchenko July 3, 2023, 12:18 p.m. UTC
GPIO library should rely only on the GPIO device's fwnode.
Hence, replace GPIO chip fwnode usage by respective fwnode
from GPIO device.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko July 3, 2023, 1:15 p.m. UTC | #1
On Mon, Jul 03, 2023 at 03:18:37PM +0300, Andy Shevchenko wrote:

...

>  static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
>  {
> -	return ACPI_HANDLE_FWNODE(gc->fwnode) == data;
> +	return ACPI_HANDLE(&gc->gpiodev->dev) == data;
>  }

And after all this may be changed to device_match_acpi_handle().
I'll update it locally, but still wait for the Benjamin to test
this before sending a v2.
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index 97496c0f9133..cafbf9597ead 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -128,7 +128,7 @@  static bool acpi_gpio_deferred_req_irqs_done;
 
 static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
 {
-	return ACPI_HANDLE_FWNODE(gc->fwnode) == data;
+	return ACPI_HANDLE(&gc->gpiodev->dev) == data;
 }
 
 /**