summaryrefslogtreecommitdiffstats
path: root/commands/oftree.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-05-19 14:01:52 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-22 08:09:13 +0200
commitc72a0504c97490c7fdf704d9552c1a9816a797b7 (patch)
tree09c66e428f892ca3f8b111e2d3409e2d7b3f1f61 /commands/oftree.c
parent9cd128d6bea2152ee2152543f688fff3be13db52 (diff)
downloadbarebox-c72a0504c97490c7fdf704d9552c1a9816a797b7.tar.gz
barebox-c72a0504c97490c7fdf704d9552c1a9816a797b7.tar.xz
oftree: remove dump support
This can now be done with the of_dump command. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/oftree.c')
-rw-r--r--commands/oftree.c42
1 files changed, 3 insertions, 39 deletions
diff --git a/commands/oftree.c b/commands/oftree.c
index 16648d62f3..db31d5901f 100644
--- a/commands/oftree.c
+++ b/commands/oftree.c
@@ -46,8 +46,6 @@ static int do_oftree(int argc, char *argv[])
int size;
int opt;
char *file = NULL;
- const char *node = "/";
- int dump = 0;
int probe = 0;
int load = 0;
int save = 0;
@@ -55,14 +53,11 @@ static int do_oftree(int argc, char *argv[])
int ret;
struct device_node *n, *root;
- while ((opt = getopt(argc, argv, "dpfn:ls")) > 0) {
+ while ((opt = getopt(argc, argv, "pfl:s:")) > 0) {
switch (opt) {
case 'l':
load = 1;
break;
- case 'd':
- dump = 1;
- break;
case 'p':
if (IS_ENABLED(CONFIG_OFDEVICE)) {
probe = 1;
@@ -74,9 +69,6 @@ static int do_oftree(int argc, char *argv[])
case 'f':
free_of = 1;
break;
- case 'n':
- node = optarg;
- break;
case 's':
save = 1;
break;
@@ -96,7 +88,7 @@ static int do_oftree(int argc, char *argv[])
if (optind < argc)
file = argv[optind];
- if (!dump && !probe && !load && !save)
+ if (!probe && !load && !save)
return COMMAND_ERROR_USAGE;
if (save) {
@@ -155,31 +147,6 @@ static int do_oftree(int argc, char *argv[])
}
}
- if (dump) {
- if (fdt) {
- root = of_unflatten_dtb(NULL, fdt);
- if (IS_ERR(root)) {
- printf("parse oftree: %s\n", strerror(-PTR_ERR(root)));
- ret = 1;
- goto out;
- }
- of_print_nodes(root, 0);
- of_delete_node(root);
- } else {
- struct device_node *n = of_find_node_by_path_or_alias(NULL, node);
- if (!n) {
- ret = -ENOENT;
- goto out;
- }
-
- of_print_nodes(n, 0);
- }
-
- ret = 0;
-
- goto out;
- }
-
if (probe) {
ret = of_probe();
if (ret)
@@ -198,15 +165,12 @@ BAREBOX_CMD_HELP_TEXT("Options:")
BAREBOX_CMD_HELP_OPT ("-l", "Load DTB to internal device tree")
BAREBOX_CMD_HELP_OPT ("-p", "probe devices from stored device tree")
BAREBOX_CMD_HELP_OPT ("-f", "free stored device tree")
-BAREBOX_CMD_HELP_OPT ("-d", "dump device tree from DTB or the parsed tree if no DTB is given")
-BAREBOX_CMD_HELP_OPT ("-n NODE", "specify root device NODE to dump for -d")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(oftree)
.cmd = do_oftree,
BAREBOX_CMD_DESC("handle device trees")
- BAREBOX_CMD_OPTS("[-lpfdn] [DTB]")
+ BAREBOX_CMD_OPTS("[-lpf] [DTB]")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_HELP(cmd_oftree_help)
- BAREBOX_CMD_COMPLETE(devicetree_file_complete)
BAREBOX_CMD_END