summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2013-08-23 09:39:16 +0200
committerHeiko Schocher <hs@denx.de>2013-08-27 05:49:52 +0200
commit880a41273265233004516351189aad126f964c86 (patch)
treeaf04bbfebd45a387b45b97211b3970d20331bd5a /common
parent2b26201a2aef0b310b7c04702b0dba5dea493f77 (diff)
downloadblackbird-obmc-uboot-880a41273265233004516351189aad126f964c86.tar.gz
blackbird-obmc-uboot-880a41273265233004516351189aad126f964c86.zip
i2c: fix i2c dev command for not using new framework
i2c dev command does not work anymore for legacy drivers because a check is executed that is valid only in the new framework. Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_i2c.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 29f5181baf..ebce7d4c3c 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1438,10 +1438,12 @@ int do_i2c_bus_num(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("Current bus is %d\n", i2c_get_bus_num());
else {
bus_no = simple_strtoul(argv[1], NULL, 10);
+#if defined(CONFIG_SYS_I2C)
if (bus_no >= CONFIG_SYS_NUM_I2C_BUSES) {
printf("Invalid bus %d\n", bus_no);
return -1;
}
+#endif
printf("Setting bus to %d\n", bus_no);
ret = i2c_set_bus_num(bus_no);
if (ret)
OpenPOWER on IntegriCloud