diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2026-03-17 11:36:12 +0100 |
|---|---|---|
| committer | Linus Walleij <linusw@kernel.org> | 2026-03-19 19:21:27 +0100 |
| commit | 1fc7de3047e169e7ae32afadf87a134cd1c68319 (patch) | |
| tree | 881c223c161260387162ec5d97990f0c00f8cc0a | |
| parent | c98324ea7849b6e5baa1774f71709b375a2c2f9e (diff) | |
| download | linux-1fc7de3047e169e7ae32afadf87a134cd1c68319.tar.gz linux-1fc7de3047e169e7ae32afadf87a134cd1c68319.zip | |
pinctrl: pinconf-generic: Validate fwnode instead of device node
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>
Signed-off-by: Linus Walleij <linusw@kernel.org>
| -rw-r--r-- | drivers/pinctrl/pinconf-generic.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 6ba44fc0dd82..08bfe504b615 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 */ |
