瀏覽代碼

Make no options to fdt print default to '/'

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Kumar Gala 17 年之前
父節點
當前提交
f738b4a759
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      common/cmd_fdt.c

+ 5 - 1
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