Skip to contentSkip to conversation

gpiolib: of: Use device_match_of_node() helper

PATCH Applied Andy Shevchenko 2 participants 3 messages Jun 29, 2022 – Jul 8, 2022 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: of: Use device_match_of_node() helper

Instead of open coding, use device_match_of_node() helper.

---
 drivers/gpio/gpiolib-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpiolib-of.c +1 -1
index 3d6c3ffd5576..23b8de98bf7c 100644
@@ -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)
Signature · 1 line
2.35.1
#1 lore raw
Quoted 1 line · Andy Shevchenko

Instead of open coding, use device_match_of_node() helper.

Any comments?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
In reply to Andy Shevchenko
Quoted 22 lines · Andy Shevchenko

Instead of open coding, use device_match_of_node() helper.

---
 drivers/gpio/gpiolib-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpiolib-of.c +1 -2
index 3d6c3ffd5576..23b8de98bf7c 100644
@@ -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)
--
Quoted 2 lines

2.35.1

Applied, thanks!

Bart