Commit b610e2ff authored by Rob Herring's avatar Rob Herring

of/unittest: remove use of node name pointer in overlay high level test

In preparation for removing the node name pointer, it needs to be
removed from of_unittest_overlay_high_level. However, it's not really
correct to use the node name without the unit-address and we should use
the full node name. This most easily done by iterating over the child
nodes with for_each_child_of_node() which is what of_get_child_by_name()
does internally. While at it, we might as well convert the outer loop to
use for_each_child_of_node() too instead of open coding it.
Reviewed-by: default avatarFrank Rowand <frank.rowand@sony.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 57361846
...@@ -2347,13 +2347,16 @@ static __init void of_unittest_overlay_high_level(void) ...@@ -2347,13 +2347,16 @@ static __init void of_unittest_overlay_high_level(void)
} }
} }
for (np = overlay_base_root->child; np; np = np->sibling) { for_each_child_of_node(overlay_base_root, np) {
if (of_get_child_by_name(of_root, np->name)) { struct device_node *base_child;
unittest(0, "illegal node name in overlay_base %s", for_each_child_of_node(of_root, base_child) {
np->name); if (!strcmp(np->full_name, base_child->full_name)) {
unittest(0, "illegal node name in overlay_base %pOFn",
np);
return; return;
} }
} }
}
/* /*
* overlay 'overlay_base' is not allowed to have root * overlay 'overlay_base' is not allowed to have root
......
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