Commit 8891123f authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Rafael J. Wysocki

software node: Fix node registration

Software node can not be registered before its parent.

Fixes: 80488a6b ("software node: Add support for static node descriptors")
Cc: 5.10+ <stable@vger.kernel.org> # 5.10+
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent a38fd874
...@@ -938,6 +938,9 @@ int software_node_register(const struct software_node *node) ...@@ -938,6 +938,9 @@ int software_node_register(const struct software_node *node)
if (software_node_to_swnode(node)) if (software_node_to_swnode(node))
return -EEXIST; return -EEXIST;
if (node->parent && !parent)
return -EINVAL;
return PTR_ERR_OR_ZERO(swnode_register(node, parent, 0)); return PTR_ERR_OR_ZERO(swnode_register(node, parent, 0));
} }
EXPORT_SYMBOL_GPL(software_node_register); EXPORT_SYMBOL_GPL(software_node_register);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment