[PATCH v1 2/4] gpio: shared: Replace open coded fwnode_is_gpiochip()

Andy Shevchenko <[email protected]>
Newsgroups org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-gpio,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Since GPIOLIB provides a helper, no need to open code it, hence
replace that piece by fwnode_is_gpiochip().

Signed-off-by: Andy Shevchenko <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.