From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"J. Neuschäfer" <j.ne@posteo.net>,
openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
"Linus Walleij" <linus.walleij@linaro.org>
Subject: [PATCH v2 1/1] pinctrl: wpcm450: Switch to use for_each_gpiochip_node() helper
Date: Thu, 20 Feb 2025 17:50:11 +0200 [thread overview]
Message-ID: <20250220155036.2734838-1-andriy.shevchenko@linux.intel.com> (raw)
Switch the code to use for_each_gpiochip_node() helper.
While at it, correct header inclusion as device property APIs
are provided in property.h.
Reviewed-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: fixed Subject, added tag (J. Neuschäfer)
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
index cdad4ef11a2f..2f97accef837 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
@@ -10,7 +10,6 @@
// block, shared between all GPIO banks
#include <linux/device.h>
-#include <linux/fwnode.h>
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
@@ -18,6 +17,7 @@
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/pinctrl/pinconf.h>
@@ -1033,7 +1033,7 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
return dev_err_probe(dev, PTR_ERR(pctrl->gpio_base),
"Resource fail for GPIO controller\n");
- device_for_each_child_node(dev, child) {
+ for_each_gpiochip_node(dev, child) {
void __iomem *dat = NULL;
void __iomem *set = NULL;
void __iomem *dirout = NULL;
@@ -1044,9 +1044,6 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
u32 reg;
int i;
- if (!fwnode_property_read_bool(child, "gpio-controller"))
- continue;
-
ret = fwnode_property_read_u32(child, "reg", ®);
if (ret < 0)
return ret;
--
2.45.1.3035.g276e886db78b
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"J. Neuschäfer" <j.ne@posteo.net>,
openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
Subject: [PATCH v2 1/1] pinctrl: wpcm450: Switch to use for_each_gpiochip_node() helper
Date: Thu, 20 Feb 2025 17:50:11 +0200 [thread overview]
Message-ID: <20250220155036.2734838-1-andriy.shevchenko@linux.intel.com> (raw)
Switch the code to use for_each_gpiochip_node() helper.
While at it, correct header inclusion as device property APIs
are provided in property.h.
Reviewed-by: J. Neuschäfer <j.ne@posteo.net>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: fixed Subject, added tag (J. Neuschäfer)
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
index cdad4ef11a2f..2f97accef837 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
@@ -10,7 +10,6 @@
// block, shared between all GPIO banks
#include <linux/device.h>
-#include <linux/fwnode.h>
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
@@ -18,6 +17,7 @@
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/pinctrl/pinconf.h>
@@ -1033,7 +1033,7 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
return dev_err_probe(dev, PTR_ERR(pctrl->gpio_base),
"Resource fail for GPIO controller\n");
- device_for_each_child_node(dev, child) {
+ for_each_gpiochip_node(dev, child) {
void __iomem *dat = NULL;
void __iomem *set = NULL;
void __iomem *dirout = NULL;
@@ -1044,9 +1044,6 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
u32 reg;
int i;
- if (!fwnode_property_read_bool(child, "gpio-controller"))
- continue;
-
ret = fwnode_property_read_u32(child, "reg", ®);
if (ret < 0)
return ret;
--
2.45.1.3035.g276e886db78b
next reply other threads:[~2025-02-20 15:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 15:50 Andy Shevchenko [this message]
2025-02-20 15:50 ` [PATCH v2 1/1] pinctrl: wpcm450: Switch to use for_each_gpiochip_node() helper Andy Shevchenko
2025-02-26 14:22 ` Andy Shevchenko
2025-02-26 14:22 ` Andy Shevchenko
2025-02-27 23:30 ` Linus Walleij
2025-02-27 23:30 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250220155036.2734838-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=j.ne@posteo.net \
--cc=j.neuschaefer@gmx.net \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.