summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2010-02-25 10:12:12 +0100
committerWolfgang Denk <wd@denx.de>2010-03-21 22:44:42 +0100
commitfaffe14f016db10f33836b018c4b304d939cf586 (patch)
treef8831e6b5b0e7836fc946e418cc4b2cf70e6aa5d /common
parenta6a04967bc2957d20799f4bb2a6b3dd0353c1cfd (diff)
downloadu-boot-imx-faffe14f016db10f33836b018c4b304d939cf586.zip
u-boot-imx-faffe14f016db10f33836b018c4b304d939cf586.tar.gz
u-boot-imx-faffe14f016db10f33836b018c4b304d939cf586.tar.bz2
cmd_i2c.c: reduced subaddress length to 3 bytes
according to some of the comments the subaddress length is 1 or 2, but we are being prepared for the case it becomes 3. However the code also accepted 4. This repairs this by changing the constand 4 to 3. Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_i2c.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 62cbd33..7531702 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -193,7 +193,7 @@ int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
for (j = 0; j < 8; j++) {
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
- if (alen > 4) {
+ if (alen > 3) {
cmd_usage(cmdtp);
return 1;
}
@@ -287,7 +287,7 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
for (j = 0; j < 8; j++) {
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
- if (alen > 4) {
+ if (alen > 3) {
cmd_usage(cmdtp);
return 1;
}
@@ -361,7 +361,7 @@ int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
for (j = 0; j < 8; j++) {
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
- if (alen > 4) {
+ if (alen > 3) {
cmd_usage(cmdtp);
return 1;
}
@@ -451,7 +451,7 @@ mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
for (j = 0; j < 8; j++) {
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
- if (alen > 4) {
+ if (alen > 3) {
cmd_usage(cmdtp);
return 1;
}
@@ -607,7 +607,7 @@ int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
for (j = 0; j < 8; j++) {
if (argv[2][j] == '.') {
alen = argv[2][j+1] - '0';
- if (alen > 4) {
+ if (alen > 3) {
cmd_usage(cmdtp);
return 1;
}