summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Rubini <rubini-list@gnudd.com>2009-07-17 14:42:11 +0200
committerHeiko Schocher <hs@denx.de>2009-07-18 10:17:53 +0200
commit6aee3048348f1b19ab89156da98bfa4f7babf24b (patch)
tree4826f2364877b16af9618b9bdfa24545eacaf464
parentbfadb17f69c256196620c32164775f063a59c34f (diff)
downloadu-boot-imx-6aee3048348f1b19ab89156da98bfa4f7babf24b.zip
u-boot-imx-6aee3048348f1b19ab89156da98bfa4f7babf24b.tar.gz
u-boot-imx-6aee3048348f1b19ab89156da98bfa4f7babf24b.tar.bz2
cmd_i2c: bugfix: add missing brace
The sub-command parser missed a brace, so "return 0;" is always taken and no error message is diplayed if you say "i2c scan" instead of "i2c probe", for example. Proper brace is added. Also, a misleading and unneeded else is removed. Signed-off-by: Alessandro Rubini <rubini@gnudd.com.it>
-rw-r--r--common/cmd_i2c.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index ae26845..8f0fc9e 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1282,17 +1282,17 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return do_i2c_crc(cmdtp, flag, argc, argv);
if (!strncmp(argv[0], "pr", 2))
return do_i2c_probe(cmdtp, flag, argc, argv);
- if (!strncmp(argv[0], "re", 2))
+ if (!strncmp(argv[0], "re", 2)) {
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
return 0;
+ }
if (!strncmp(argv[0], "lo", 2))
return do_i2c_loop(cmdtp, flag, argc, argv);
#if defined(CONFIG_CMD_SDRAM)
if (!strncmp(argv[0], "sd", 2))
return do_sdram(cmdtp, flag, argc, argv);
#endif
- else
- cmd_usage(cmdtp);
+ cmd_usage(cmdtp);
return 0;
}