Make no options to fdt print default to '/'
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index f18c583..b665bd6 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -229,6 +229,7 @@
char *pathp; /* path */
char *prop; /* property */
int ret; /* return value */
+ static char root[2] = "/";
/*
* list is an alias for print, but limited to 1 level
@@ -241,7 +242,10 @@
* Get the starting path. The root node is an oddball,
* the offset is zero and has no name.
*/
- pathp = argv[2];
+ if (argc == 2)
+ pathp = root;
+ else
+ pathp = argv[2];
if (argc > 3)
prop = argv[3];
else