public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC][PATCH v2 08/19] i2c: fix command usage help
Date: Tue, 03 Aug 2010 12:15:19 +0200	[thread overview]
Message-ID: <4C57EC37.3070601@denx.de> (raw)
In-Reply-To: <4C526B7E.3000605@denx.de>

Signed-off-by: Heiko Schocher <hs@denx.de>
---
- 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(-)

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index a1a84a1..48de54b 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1297,6 +1297,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++;
-- 
1.6.2.5

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

      reply	other threads:[~2010-08-03 10:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 10:44 [U-Boot] [RFC][PATCH 08/19] i2c: fix command usage help Heiko Schocher
2010-07-29 15:40 ` Peter Tyser
2010-07-30  6:04   ` Heiko Schocher
2010-08-03 10:15     ` Heiko Schocher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C57EC37.3070601@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox