From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Linus Walleij <linusw@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/3] pinctrl: pinconf-generic: Validate fwnode instead of device node
Date: Tue, 17 Mar 2026 11:36:12 +0100 [thread overview]
Message-ID: <20260317103817.1982584-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20260317103817.1982584-1-andriy.shevchenko@linux.intel.com>
Currently we convert device node to fwnode in the
pinconf_generic_parse_dt_config() and then validate the device node.
This is confusing order. Instead, assign fwnode and validate it.
Fixes: e002d162654b ("pinctrl: pinconf-generic: Use only fwnode API in parse_dt_cfg()")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/pinconf-generic.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index d0b825ff52db..0ed57720ae61 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -377,12 +377,13 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
unsigned long **configs,
unsigned int *nconfigs)
{
- struct fwnode_handle *fwnode = of_fwnode_handle(np);
unsigned long *cfg;
unsigned int max_cfg, ncfg = 0;
+ struct fwnode_handle *fwnode;
int ret;
- if (!np)
+ fwnode = of_fwnode_handle(np);
+ if (!fwnode)
return -EINVAL;
/* allocate a temporary array big enough to hold one of each option */
--
2.50.1
next prev parent reply other threads:[~2026-03-17 10:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 10:36 [PATCH v1 0/3] pinctrl: pinconf-generic: More fwnode related conversions Andy Shevchenko
2026-03-17 10:36 ` [PATCH v1 1/3] pinctrl: pinconf-generic: Fully validate 'pinmux' property Andy Shevchenko
2026-03-17 10:36 ` Andy Shevchenko [this message]
2026-03-17 10:36 ` [PATCH v1 3/3] pinctrl: pinconf-generic: Convert ..._parse_dt_pinmux() to fwnode API Andy Shevchenko
2026-03-19 18:22 ` [PATCH v1 0/3] pinctrl: pinconf-generic: More fwnode related conversions 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=20260317103817.1982584-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox