aboutsummaryrefslogtreecommitdiff
path: root/common/cmd_i2c.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-12-10 08:44:01 +0000
committerWolfgang Denk <wd@denx.de>2012-03-06 21:09:46 +0100
commit4c12eeb8b55483e48ef98b8a480e2bbacc9f210d (patch)
tree7624947e7cd097d48ea3a2e1a3ccfa82ee766fc4 /common/cmd_i2c.c
parent9d12d5d41d5653ba2f943886f45b8c2eb0f63450 (diff)
downloadu-boot-4c12eeb8b55483e48ef98b8a480e2bbacc9f210d.zip
u-boot-4c12eeb8b55483e48ef98b8a480e2bbacc9f210d.tar.gz
u-boot-4c12eeb8b55483e48ef98b8a480e2bbacc9f210d.tar.bz2
Convert cmd_usage() calls in common to use a return value
Change all files in common/ to use CMD_RET_USAGE instead of calling cmd_usage() directly. I'm not completely sure about this patch since the code since impact is small (100 byte or so on ARM) and it might need splitting into smaller patches. But for now here it is. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cmd_i2c.c')
-rw-r--r--common/cmd_i2c.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index e795139..2cdc4ed 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -190,7 +190,7 @@ static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
u_char *memaddr;
if (argc != 5)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* I2C chip address
@@ -204,7 +204,7 @@ static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
devaddr = simple_strtoul(argv[2], NULL, 16);
alen = get_alen(argv[2]);
if (alen > 3)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* Length is the number of objects, not number of bytes.
@@ -242,7 +242,7 @@ static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
length = i2c_dp_last_length;
if (argc < 3)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
if ((flag & CMD_FLAG_REPEAT) == 0) {
/*
@@ -261,7 +261,7 @@ static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
addr = simple_strtoul(argv[2], NULL, 16);
alen = get_alen(argv[2]);
if (alen > 3)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* If another parameter, it is the length to display.
@@ -330,7 +330,7 @@ static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
int count;
if ((argc < 4) || (argc > 5))
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* Chip is always specified.
@@ -343,7 +343,7 @@ static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
addr = simple_strtoul(argv[2], NULL, 16);
alen = get_alen(argv[2]);
if (alen > 3)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* Value to write is always specified.
@@ -392,7 +392,7 @@ static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
ulong err;
if (argc < 4)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* Chip is always specified.
@@ -405,7 +405,7 @@ static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
addr = simple_strtoul(argv[2], NULL, 16);
alen = get_alen(argv[2]);
if (alen > 3)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* Count is always specified
@@ -451,7 +451,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
int nbytes;
if (argc != 3)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
#ifdef CONFIG_BOOT_RETRY_TIME
reset_cmd_timeout(); /* got a good command to get here */
@@ -482,7 +482,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const arg
addr = simple_strtoul(argv[2], NULL, 16);
alen = get_alen(argv[2]);
if (alen > 3)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
}
/*
@@ -613,7 +613,7 @@ static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
int delay;
if (argc < 3)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* Chip is always specified.
@@ -626,7 +626,7 @@ static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
addr = simple_strtoul(argv[2], NULL, 16);
alen = get_alen(argv[2]);
if (alen > 3)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* Length is the number of objects, not number of bytes.
@@ -765,7 +765,7 @@ static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
};
if (argc < 2)
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
/*
* Chip is always specified.
@@ -1300,7 +1300,7 @@ 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);
+ return CMD_RET_USAGE;
/* Strip off leading 'i2c' command argument */
argc--;
@@ -1309,9 +1309,9 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
c = find_cmd_tbl(argv[0], &cmd_i2c_sub[0], ARRAY_SIZE(cmd_i2c_sub));
if (c)
- return c->cmd(cmdtp, flag, argc, argv);
+ return c->cmd(cmdtp, flag, argc, argv);
else
- return cmd_usage(cmdtp);
+ return CMD_RET_USAGE;
}
/***************************************************/