summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-12-29 05:22:50 -0700
committerSimon Glass <sjg@chromium.org>2016-01-20 19:06:22 -0700
commit4fbd258e69373a60cdf24c9a64065b486f8748c9 (patch)
tree5067e1b3a84ce4696d0e24840bb50222c7266765 /common
parent4a1db6d8ab4d5e4565bda079710a028ada12ddbe (diff)
downloadblackbird-obmc-uboot-4fbd258e69373a60cdf24c9a64065b486f8748c9.tar.gz
blackbird-obmc-uboot-4fbd258e69373a60cdf24c9a64065b486f8748c9.zip
i2c: Correct command return values
We should not return a -ve error code from command functions. Instead, return CMD_RET_FAILURE. This avoids the "exit not allowed from main input shell" error messages from the hush shell. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_i2c.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 552c875f62..b3bb64408f 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1809,7 +1809,8 @@ static int do_i2c_bus_num(cmd_tbl_t *cmdtp, int flag, int argc,
if (ret)
printf("Failure changing bus number (%d)\n", ret);
}
- return ret;
+
+ return ret ? CMD_RET_FAILURE : 0;
}
#endif /* defined(CONFIG_SYS_I2C) */
@@ -1852,7 +1853,8 @@ static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const
if (ret)
printf("Failure changing bus speed (%d)\n", ret);
}
- return ret;
+
+ return ret ? CMD_RET_FAILURE : 0;
}
/**
OpenPOWER on IntegriCloud