summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-06-11 08:36:28 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-06-11 22:36:58 +0200
commitc39c70bac5207b27235e98abbc78e135ce4a1126 (patch)
tree24e5efe127f43cdf8918a34ed965076053241704
parent64a6088dbee486d180c5c2698769660bcddb16e4 (diff)
downloadbarebox-c39c70bac5207b27235e98abbc78e135ce4a1126.tar.gz
barebox-c39c70bac5207b27235e98abbc78e135ce4a1126.tar.xz
commands: oftree: kill oftree -f
Being able to free the live device tree seemed like a good idea in the early days of device tree support when the first boards were brought up. It turned out to be illusory that noone stores pointers to the live tree which become invalid when oftree -f is executed. Enough people stumbled upon crashed boards with this option, so remove it finally. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--commands/oftree.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/commands/oftree.c b/commands/oftree.c
index 8a47c0be58..26a47bb581 100644
--- a/commands/oftree.c
+++ b/commands/oftree.c
@@ -48,7 +48,6 @@ static int do_oftree(int argc, char *argv[])
int probe = 0;
char *load = NULL;
char *save = NULL;
- int free_of = 0;
int ret;
struct device_node *root;
@@ -65,25 +64,12 @@ static int do_oftree(int argc, char *argv[])
return COMMAND_ERROR_USAGE;
}
break;
- case 'f':
- free_of = 1;
- break;
case 's':
save = optarg;
break;
}
}
- if (free_of) {
- struct device_node *root = of_get_root_node();
-
- if (root)
- of_delete_node(root);
-
- if (!load)
- return 0;
- }
-
if (!probe && !load && !save)
return COMMAND_ERROR_USAGE;
@@ -140,13 +126,12 @@ BAREBOX_CMD_HELP_TEXT("Options:")
BAREBOX_CMD_HELP_OPT ("-l <DTB>", "Load <DTB> to internal devicetree\n")
BAREBOX_CMD_HELP_OPT ("-s <DTB>", "save internal devicetree to <DTB>\n")
BAREBOX_CMD_HELP_OPT ("-p", "probe devices from stored device tree")
-BAREBOX_CMD_HELP_OPT ("-f", "free stored device tree")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(oftree)
.cmd = do_oftree,
BAREBOX_CMD_DESC("handle device trees")
- BAREBOX_CMD_OPTS("[-lspf]")
+ BAREBOX_CMD_OPTS("[-lsp]")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_HELP(cmd_oftree_help)
BAREBOX_CMD_END