[PATCH v1 2/4] gpio: shared: Replace open coded fwnode_is_gpiochip()
From: Andy Shevchenko
Date: Mon Aug 24 2026 - 03:51:50 EST
Since GPIOLIB provides a helper, no need to open code it, hence
replace that piece by fwnode_is_gpiochip().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
drivers/gpio/gpiolib-shared.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c
index 495bd3d0ddf0..be90926dffcc 100644
--- a/drivers/gpio/gpiolib-shared.c
+++ b/drivers/gpio/gpiolib-shared.c
@@ -203,9 +203,8 @@ static int gpio_shared_of_traverse(struct device_node *curr)
if (ret)
continue;
- np = args.np;
-
- if (!of_property_present(np, "gpio-controller"))
+ fwnode = of_fwnode_handle(args.np);
+ if (!fwnode_is_gpiochip(fwnode))
continue;
/*
@@ -222,7 +221,6 @@ static int gpio_shared_of_traverse(struct device_node *curr)
if (args.args_count != 2)
continue;
- fwnode = of_fwnode_handle(args.np);
offset = args.args[0];
entry = gpio_shared_find_entry(fwnode, offset);
--
2.50.1