Skip to content

Commit fca8ba4

Browse files
committed
of/unittest: Remove obsolete code
Commit 3ce04b4, "Removes OF_UNITTEST dependency on OF_DYNAMIC config symbol" removes a bunch of code, but missed a few minor bits. Clean it up by removing the node removal cache and flag. Signed-off-by: Grant Likely <[email protected]> Cc: Gaurav Minocha <[email protected]> Cc: Rob Herring <[email protected]>
1 parent e94fbe6 commit fca8ba4

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

drivers/of/unittest.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ static struct selftest_results {
2727
int failed;
2828
} selftest_results;
2929

30-
#define NO_OF_NODES 3
31-
static struct device_node *nodes[NO_OF_NODES];
32-
static int last_node_index;
33-
static bool selftest_live_tree;
34-
3530
#define selftest(result, fmt, ...) ({ \
3631
bool failed = !(result); \
3732
if (failed) { \
@@ -830,13 +825,6 @@ static int attach_node_and_children(struct device_node *np)
830825
return 0;
831826
}
832827

833-
/* Children of the root need to be remembered for removal */
834-
if (np->parent == of_root) {
835-
if (WARN_ON(last_node_index >= NO_OF_NODES))
836-
return -EINVAL;
837-
nodes[last_node_index++] = np;
838-
}
839-
840828
child = np->child;
841829
np->child = NULL;
842830

@@ -899,10 +887,7 @@ static int __init selftest_data_add(void)
899887
}
900888

901889
if (!of_root) {
902-
/* enabling flag for removing nodes */
903-
selftest_live_tree = true;
904890
of_root = selftest_data_node;
905-
906891
for_each_of_allnodes(np)
907892
__of_attach_node_sysfs(np);
908893
of_aliases = of_find_node_by_path("/aliases");

0 commit comments

Comments
 (0)