]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: pinconf-generic: Validate fwnode instead of device node
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 17 Mar 2026 10:36:12 +0000 (11:36 +0100)
committerLinus Walleij <linusw@kernel.org>
Thu, 19 Mar 2026 18:21:27 +0000 (19:21 +0100)
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>
drivers/pinctrl/pinconf-generic.c

index 6ba44fc0dd82b7d771af6904f859b46a2c8034be..08bfe504b6156a33c8186c14325398690c917a42 100644 (file)
@@ -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 */