Re: [PATCH v3 1/2] software node: return -ENOTCONN when referenced swnode is not registered yet

From: Sakari Ailus

Date: Tue Apr 07 2026 - 03:06:53 EST


Hi Bartosz,

Thanks for the update.

On Fri, Apr 03, 2026 at 03:51:50PM +0200, Bartosz Golaszewski wrote:
> 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".
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
> ---
> drivers/base/swnode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> index 51320837f3a9f1bf4f65aa161d9b941affc74936..61e73417aee89feb855b0f429e112ca0af78a003 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;

This needs to be documented for fwnode_property_get_reference_args() as
well.

In V4L2 we do
<URL:https://lore.kernel.org/linux-media/20260313091122.GA333526@xxxxxxxxxxxxxxxxxxxxxxxxxx/T/#t>
so the caller just returns the error code but maybe that's not generic
enough.

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

--
Kind regards,

Sakari Ailus