summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-10-25 16:15:07 -0500
committerKumar Gala <galak@kernel.crashing.org>2007-11-21 14:01:49 -0600
commitf738b4a75998f42a7408defadc9baac7a31c92db (patch)
treec842c2d2f7f4fbd1f60eabe9664bee71d0961db4 /common
parenta3c2933e02503fe36ade2c1b65af46f2b7a168e7 (diff)
downloadu-boot-imx-f738b4a75998f42a7408defadc9baac7a31c92db.zip
u-boot-imx-f738b4a75998f42a7408defadc9baac7a31c92db.tar.gz
u-boot-imx-f738b4a75998f42a7408defadc9baac7a31c92db.tar.bz2
Make no options to fdt print default to '/'
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_fdt.c6
1 files changed, 5 insertions, 1 deletions
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 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
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 @@ int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
* 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