gpio: swnode: defer probe on references to unregistered software nodes
fwnode_property_get_reference_args() now returns -ENOTCONN when called on a software node referencing another software node which has not yet been registered as a firmware node. It makes sense to defer probe in this situation as the node will most likely be registered later on and we'll be able to resolve the reference eventually. Change the behavior of swnode_find_gpio() to return -EPROBE_DEFER if the software node reference resolution returns -ENOTCONN. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20260407-swnode-unreg-retcode-v4-2-1b2f0725eb9c@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>master
parent
5bcd451286
commit
ca13ab6540
|
|
@ -93,6 +93,14 @@ struct gpio_desc *swnode_find_gpio(struct fwnode_handle *fwnode,
|
|||
ret = swnode_gpio_get_reference(fwnode, propname, idx, &args);
|
||||
if (ret == 0)
|
||||
break;
|
||||
if (ret == -ENOTCONN)
|
||||
/*
|
||||
* -ENOTCONN for a software node reference lookup means
|
||||
* that a remote struct software_node exists but has
|
||||
* not yet been registered as a firmware node. Defer
|
||||
* until this happens.
|
||||
*/
|
||||
return ERR_PTR(-EPROBE_DEFER);
|
||||
}
|
||||
if (ret) {
|
||||
pr_debug("%s: can't parse '%s' property of node '%pfwP[%d]'\n",
|
||||
|
|
|
|||
Loading…
Reference in New Issue