public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] gpiolib: of: Make use of device_match_of_node()
@ 2022-11-03 20:30 Andy Shevchenko
  2022-11-03 20:36 ` Dmitry Torokhov
  2022-11-04 15:11 ` Bartosz Golaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2022-11-03 20:30 UTC (permalink / raw)
  To: Bartosz Golaszewski, Dmitry Torokhov, linux-gpio, linux-kernel
  Cc: Linus Walleij, Andy Shevchenko

Make use of device_match_of_node() instead of open coding its
functionality.

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

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 52616848a37c..4b91e19366a8 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -85,7 +85,7 @@ static int of_gpiochip_match_node_and_xlate(struct gpio_chip *chip, void *data)
 {
 	struct of_phandle_args *gpiospec = data;
 
-	return chip->gpiodev->dev.of_node == gpiospec->np &&
+	return device_match_of_node(&chip->gpiodev->dev, gpiospec->np) &&
 				chip->of_xlate &&
 				chip->of_xlate(chip, gpiospec, NULL) >= 0;
 }
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] gpiolib: of: Make use of device_match_of_node()
  2022-11-03 20:30 [PATCH v1 1/1] gpiolib: of: Make use of device_match_of_node() Andy Shevchenko
@ 2022-11-03 20:36 ` Dmitry Torokhov
  2022-11-04 15:11 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2022-11-03 20:36 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Bartosz Golaszewski, linux-gpio, linux-kernel, Linus Walleij

On Thu, Nov 03, 2022 at 10:30:05PM +0200, Andy Shevchenko wrote:
> Make use of device_match_of_node() instead of open coding its
> functionality.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/gpio/gpiolib-of.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 52616848a37c..4b91e19366a8 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -85,7 +85,7 @@ static int of_gpiochip_match_node_and_xlate(struct gpio_chip *chip, void *data)
>  {
>  	struct of_phandle_args *gpiospec = data;
>  
> -	return chip->gpiodev->dev.of_node == gpiospec->np &&
> +	return device_match_of_node(&chip->gpiodev->dev, gpiospec->np) &&
>  				chip->of_xlate &&
>  				chip->of_xlate(chip, gpiospec, NULL) >= 0;
>  }
> -- 
> 2.35.1
> 

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] gpiolib: of: Make use of device_match_of_node()
  2022-11-03 20:30 [PATCH v1 1/1] gpiolib: of: Make use of device_match_of_node() Andy Shevchenko
  2022-11-03 20:36 ` Dmitry Torokhov
@ 2022-11-04 15:11 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2022-11-04 15:11 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Dmitry Torokhov, linux-gpio, linux-kernel, Linus Walleij

On Thu, Nov 3, 2022 at 9:29 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Make use of device_match_of_node() instead of open coding its
> functionality.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpiolib-of.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 52616848a37c..4b91e19366a8 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -85,7 +85,7 @@ static int of_gpiochip_match_node_and_xlate(struct gpio_chip *chip, void *data)
>  {
>         struct of_phandle_args *gpiospec = data;
>
> -       return chip->gpiodev->dev.of_node == gpiospec->np &&
> +       return device_match_of_node(&chip->gpiodev->dev, gpiospec->np) &&
>                                 chip->of_xlate &&
>                                 chip->of_xlate(chip, gpiospec, NULL) >= 0;
>  }
> --
> 2.35.1
>

Applied, thanks!

Bartosz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-04 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-03 20:30 [PATCH v1 1/1] gpiolib: of: Make use of device_match_of_node() Andy Shevchenko
2022-11-03 20:36 ` Dmitry Torokhov
2022-11-04 15:11 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox