[U-Boot] [RFC][PATCH 08/19] i2c: fix command usage help
Heiko Schocher
hs at denx.de
Thu Jul 29 12:44:45 CEST 2010
Signed-off-by: Heiko Schocher <hs at denx.de>
---
common/cmd_i2c.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index a1a84a1..91e60ae 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1297,6 +1297,11 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
cmd_tbl_t *c;
+ if (argc < 2) {
+ cmd_usage(cmdtp);
+ return 1;
+ }
+
/* Strip off leading 'i2c' command argument */
argc--;
argv++;
--
1.6.2.5
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
More information about the U-Boot
mailing list