Skip to content

Commit fd25ffd

Browse files
frowandrobherring
authored andcommitted
of: unittest: remove report of expected error
update_node_properties() reports an error when the test data contains a node (such as "/aliases") that already exists in the base devicetree. The error is caused by of_fdt_unflatten_tree() autogenerating the "name" property, thus both the existing node and the new node will have a property with the same name. Suppress reporting the known error. Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 36c79bc commit fd25ffd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/of/unittest.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,12 @@ static void update_node_properties(struct device_node *np,
11161116
for (prop = np->properties; prop != NULL; prop = save_next) {
11171117
save_next = prop->next;
11181118
ret = of_add_property(dup, prop);
1119-
if (ret)
1119+
if (ret) {
1120+
if (ret == -EEXIST && !strcmp(prop->name, "name"))
1121+
continue;
11201122
pr_err("unittest internal error: unable to add testdata property %pOF/%s",
11211123
np, prop->name);
1124+
}
11221125
}
11231126
}
11241127

0 commit comments

Comments
 (0)