lkml.org 
[lkml]   [2021]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 3/3] gpiolib: acpi: Replace custom code with device_match_acpi_handle()
On Wed, Oct 6, 2021 at 7:31 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> 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>
> ---
> v2: no changes
> drivers/gpio/gpiolib-acpi.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> index 47712b6903b5..32f1f720b94b 100644
> --- a/drivers/gpio/gpiolib-acpi.c
> +++ b/drivers/gpio/gpiolib-acpi.c
> @@ -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) : false;

return gc->parent && device_match_acpi_handle(gc->parent, data);

would work too if I'm not mistaken.

> }
>
> /**
> --

\
 
 \ /
  Last update: 2021-10-07 18:51    [W:0.045 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site