Skip to content

Commit 8f4c13c

Browse files
Bartosz GolaszewskiDanilo Krummrich
authored andcommitted
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>
1 parent a2225b6 commit 8f4c13c

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/base/property.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,8 @@ EXPORT_SYMBOL_GPL(fwnode_property_match_property_string);
594594
* %-ENOENT when the index is out of bounds, the index has an empty
595595
* reference or the property was not found
596596
* %-EINVAL on parse error
597+
* %-ENOTCONN when the remote firmware node exists but has not been
598+
* registered yet
597599
*/
598600
int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode,
599601
const char *prop, const char *nargs_prop,

drivers/base/swnode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ software_node_get_reference_args(const struct fwnode_handle *fwnode,
554554
return -EINVAL;
555555

556556
if (!refnode)
557-
return -ENOENT;
557+
return -ENOTCONN;
558558

559559
if (nargs_prop) {
560560
error = fwnode_property_read_u32(refnode, nargs_prop, &nargs_prop_val);

0 commit comments

Comments
 (0)