Skip to contentSkip to conversation

i2c: fix i2c dev command for not using new framework

PATCH New Stefano Babic 1 participant 1 message Aug 23, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: fix i2c dev command for not using new framework

From: Heiko Schocher <[email protected]>

i2c dev command does not work anymore for legacy drivers because a check is executed that is valid only in the new framework.

---
 common/cmd_i2c.c |    2 ++
 1 file changed, 2 insertions(+)
common/cmd_i2c.c +2 -0
index 29f5181..ebce7d4 100644
@@ -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)
Signature · 1 line
1.7.9.5