summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/oftree.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/commands/oftree.c b/commands/oftree.c
index 83ffe12f75..612d01afa5 100644
--- a/commands/oftree.c
+++ b/commands/oftree.c
@@ -156,7 +156,14 @@ static int do_oftree(int argc, char *argv[])
if (dump) {
if (fdt) {
- ret = fdt_print(fdt, node);
+ 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_free(root);
} else {
struct device_node *root, *n;
@@ -174,10 +181,10 @@ static int do_oftree(int argc, char *argv[])
}
of_print_nodes(n, 0);
-
- ret = 0;
}
+ ret = 0;
+
goto out;
}