summaryrefslogtreecommitdiffstats
path: root/commands/oftree.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-17 19:12:13 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-03-06 11:41:28 +0100
commit983686fc1fd4444cbcc1f7eb194d0269d32d3bbe (patch)
treee209bc9695439b7fef36be7dcc6b8ca5c42c1e4c /commands/oftree.c
parent32bbb9455d43d23d53e2c41c5328b076e12a7bb9 (diff)
downloadbarebox-983686fc1fd4444cbcc1f7eb194d0269d32d3bbe.tar.gz
barebox-983686fc1fd4444cbcc1f7eb194d0269d32d3bbe.tar.xz
oftree command: Use of_print_nodes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/oftree.c')
-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;
}