[U-Boot] [PATCH 1/2] cmd_onenand.c: Fix command usage help.

Enric Balletbo i Serra eballetbo at iseebcn.com
Tue Oct 19 11:13:21 CEST 2010


Running the onenand command without arguments does nothing, with this
patch shows the command usage.

Signed-off-by: Enric Balletbo i Serra <eballetbo at iseebcn.com>
---
 common/cmd_onenand.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index 83d967b..317968f 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -529,6 +529,9 @@ static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]
 {
 	cmd_tbl_t *c;
 
+	if (argc < 2)
+		return cmd_usage(cmdtp);
+
 	mtd = &onenand_mtd;
 
 	/* Strip off leading 'onenand' command argument */
-- 
1.7.0.4



More information about the U-Boot mailing list