Skip to content

Commit 1cb73c8

Browse files
Heikki Krogerusgregkh
Heikki Krogerus
authored andcommitted
software node: Fix node registration
commit 8891123 upstream. Software node can not be registered before its parent. Fixes: 80488a6 ("software node: Add support for static node descriptors") Cc: 5.10+ <[email protected]> # 5.10+ Signed-off-by: Heikki Krogerus <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3bc2666 commit 1cb73c8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/base/swnode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,9 @@ int software_node_register(const struct software_node *node)
812812
if (software_node_to_swnode(node))
813813
return -EEXIST;
814814

815+
if (node->parent && !parent)
816+
return -EINVAL;
817+
815818
return PTR_ERR_OR_ZERO(swnode_register(node, parent, 0));
816819
}
817820
EXPORT_SYMBOL_GPL(software_node_register);

0 commit comments

Comments
 (0)