From: Bartosz Golaszewski Date: Tue, 7 Apr 2026 13:27:57 +0000 (+0200) Subject: software node: return -ENOTCONN when referenced swnode is not registered yet X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f4c13c2674d37bcbbdfc47c28ce0ca1a40a6682;p=thirdparty%2Fkernel%2Flinux.git software node: return -ENOTCONN when referenced swnode is not registered yet It's possible that at the time of resolving a reference to a remote software node, the node we know exists is not yet registered as a full firmware node. We currently return -ENOENT in this case but the same error code is also returned in some other cases, like the reference property with given name not existing in the property list of the local software node. It makes sense to let users know that we're dealing with an unregistered software node so that they can defer probe - the situation is somewhat similar to there existing a firmware node to which no device is bound yet - which is valid grounds for probe deferral. To that end: use -ENOTCONN to indicate the software node is "not connected". Acked-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski Link: https://patch.msgid.link/20260407-swnode-unreg-retcode-v4-1-1b2f0725eb9c@oss.qualcomm.com [ Drop software node backend specifics from fwnode_property_get_reference_args() documentation. - Danilo ] Signed-off-by: Danilo Krummrich --- diff --git a/drivers/base/property.c b/drivers/base/property.c index 8d9a34be57fb..d21ae5419a71 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -594,6 +594,8 @@ EXPORT_SYMBOL_GPL(fwnode_property_match_property_string); * %-ENOENT when the index is out of bounds, the index has an empty * reference or the property was not found * %-EINVAL on parse error + * %-ENOTCONN when the remote firmware node exists but has not been + * registered yet */ int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode, const char *prop, const char *nargs_prop, diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 51320837f3a9..61e73417aee8 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -554,7 +554,7 @@ software_node_get_reference_args(const struct fwnode_handle *fwnode, return -EINVAL; if (!refnode) - return -ENOENT; + return -ENOTCONN; if (nargs_prop) { error = fwnode_property_read_u32(refnode, nargs_prop, &nargs_prop_val);