gpiolib: acpi: Replace custom code with device_match_acpi_handle()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 14 Oct 2021 13:47:56 +0000 (16:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 17:39:01 +0000 (19:39 +0200)
Since driver core provides a generic device_match_acpi_handle()
we may replace the custom code with it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20211014134756.39092-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpiolib-acpi.c

index 47712b6903b51fecb1d5d9f4f1648f80de68d417..985e8589c58ba77fc110c20f54de5f458872760f 100644 (file)
@@ -95,10 +95,7 @@ static bool acpi_gpio_deferred_req_irqs_done;
 
 static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
 {
-       if (!gc->parent)
-               return false;
-
-       return ACPI_HANDLE(gc->parent) == data;
+       return gc->parent && device_match_acpi_handle(gc->parent, data);
 }
 
 /**