Skip to contentSkip to conversation

i2c: fix command usage help

PATCH New Heiko Schocher 1 participant 1 message Aug 11, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 8/26 i2c: fix command usage help

---
- changes since v1
added comment from Peter Tyser
- simplified this patch as cmd_usage() returns 1

 common/cmd_i2c.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
common/cmd_i2c.c +3 -0
index 371e022..5e9135e 100644
@@ -1291,6 +1291,9 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	cmd_tbl_t *c;
 
+	if (argc < 2)
+		return cmd_usage(cmdtp);
+
 	/* Strip off leading 'i2c' command argument */
 	argc--;
 	argv++;
Signature · 5 lines
1.6.2.5

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany