Message ID | 20220629113058.79617-1-andriy.shevchenko@linux.intel.com |
---|---|
State | Accepted |
Commit | 597a8a888d349c3804e92ef087646bd9a89fe53d |
Headers | show |
Series | [v1,1/1] gpiolib: of: Use device_match_of_node() helper | expand |
On Wed, Jun 29, 2022 at 02:30:58PM +0300, Andy Shevchenko wrote:
> Instead of open coding, use device_match_of_node() helper.
Any comments?
On Wed, Jun 29, 2022 at 1:30 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > > Instead of open coding, use device_match_of_node() helper. > > 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 3d6c3ffd5576..23b8de98bf7c 100644 > --- a/drivers/gpio/gpiolib-of.c > +++ b/drivers/gpio/gpiolib-of.c > @@ -720,7 +720,7 @@ static void of_gpiochip_remove_hog(struct gpio_chip *chip, > > static int of_gpiochip_match_node(struct gpio_chip *chip, void *data) > { > - return chip->gpiodev->dev.of_node == data; > + return device_match_of_node(&chip->gpiodev->dev, data); > } > > static struct gpio_chip *of_find_gpiochip_by_node(struct device_node *np) > -- > 2.35.1 > Applied, thanks! Bart
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 3d6c3ffd5576..23b8de98bf7c 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -720,7 +720,7 @@ static void of_gpiochip_remove_hog(struct gpio_chip *chip, static int of_gpiochip_match_node(struct gpio_chip *chip, void *data) { - return chip->gpiodev->dev.of_node == data; + return device_match_of_node(&chip->gpiodev->dev, data); } static struct gpio_chip *of_find_gpiochip_by_node(struct device_node *np)
Instead of open coding, use device_match_of_node() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/gpio/gpiolib-of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)