Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Andy Shevchenko and committed by
Linus Walleij
1fc7de30 c98324ea

+3 -2
+3 -2
drivers/pinctrl/pinconf-generic.c
··· 377 377 unsigned long **configs, 378 378 unsigned int *nconfigs) 379 379 { 380 - struct fwnode_handle *fwnode = of_fwnode_handle(np); 381 380 unsigned long *cfg; 382 381 unsigned int max_cfg, ncfg = 0; 382 + struct fwnode_handle *fwnode; 383 383 int ret; 384 384 385 - if (!np) 385 + fwnode = of_fwnode_handle(np); 386 + if (!fwnode) 386 387 return -EINVAL; 387 388 388 389 /* allocate a temporary array big enough to hold one of each option */