summaryrefslogtreecommitdiff
path: root/drivers/of/unittest.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2014-11-24 14:50:07 +0000
committerGrant Likely <grant.likely@linaro.org>2014-11-24 14:50:07 +0000
commit66e6a5a1fcd2f3e05f4d499b539a1f77ceb52d1d (patch)
treed72f980f64b88ea4e976215a503fcb038e02f981 /drivers/of/unittest.c
parent2d0747c4b68be8eb8ccfa2c538f2f5dd2ea89094 (diff)
parent5d01410fe4d92081f349b013a2e7a95429e4f2c9 (diff)
Merge tag 'v3.18-rc6' into devicetree/next
v3.18-rc6 contains an important DT bug fix, c1a2086e2d, "of/selftest: Fix off-by-one error in removal path" which affects testing of the overlay patch series. Merge it into the devicetree/next staging branch so that the overlay patches are applied on top of a known working tree. Linux 3.18-rc6 Conflicts: drivers/of/address.c
Diffstat (limited to 'drivers/of/unittest.c')
-rw-r--r--drivers/of/unittest.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 082bb2b6a5ad..46af7019d291 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -908,10 +908,14 @@ static void selftest_data_remove(void)
return;
}
- while (last_node_index >= 0) {
+ while (last_node_index-- > 0) {
if (nodes[last_node_index]) {
np = of_find_node_by_path(nodes[last_node_index]->full_name);
- if (strcmp(np->full_name, "/aliases") != 0) {
+ if (np == nodes[last_node_index]) {
+ if (of_aliases == np) {
+ of_node_put(of_aliases);
+ of_aliases = NULL;
+ }
detach_node_and_children(np);
} else {
for_each_property_of_node(np, prop) {
@@ -920,7 +924,6 @@ static void selftest_data_remove(void)
}
}
}
- last_node_index--;
}
}
@@ -933,6 +936,8 @@ static int __init of_selftest(void)
res = selftest_data_add();
if (res)
return res;
+ if (!of_aliases)
+ of_aliases = of_find_node_by_path("/aliases");
np = of_find_node_by_path("/testcase-data/phandle-tests/consumer-a");
if (!np) {