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.

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 <andy@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
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 <dakr@kernel.org>

authored by

Bartosz Golaszewski and committed by
Danilo Krummrich
8f4c13c2 a2225b6e

+3 -1
+2
drivers/base/property.c
··· 594 594 * %-ENOENT when the index is out of bounds, the index has an empty 595 595 * reference or the property was not found 596 596 * %-EINVAL on parse error 597 + * %-ENOTCONN when the remote firmware node exists but has not been 598 + * registered yet 597 599 */ 598 600 int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode, 599 601 const char *prop, const char *nargs_prop,
+1 -1
drivers/base/swnode.c
··· 554 554 return -EINVAL; 555 555 556 556 if (!refnode) 557 - return -ENOENT; 557 + return -ENOTCONN; 558 558 559 559 if (nargs_prop) { 560 560 error = fwnode_property_read_u32(refnode, nargs_prop, &nargs_prop_val);