
Dear ksi@koi8.net,
In message Pine.LNX.4.64ksi.0902121409460.21067@home-gw.koi8.net you wrote:
Signed-off-by: Sergey Kubushyn ksi@koi8.net
diff -purN u-boot-i2c.orig/common/cmd_date.c u-boot-i2c/common/cmd_date.c --- u-boot-i2c.orig/common/cmd_date.c 2009-02-12 10:43:41.000000000 -0800 +++ u-boot-i2c/common/cmd_date.c 2009-02-12 10:46:00.000000000 -0800 @@ -46,8 +46,13 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int old_bus;
/* switch to correct I2C bus */ +#ifdef CONFIG_NEW_I2C
- old_bus = i2c_get_bus_num();
- i2c_set_bus_num(CONFIG_SYS_RTC_BUS_NUM);
+#else old_bus = I2C_GET_BUS(); I2C_SET_BUS(CONFIG_SYS_RTC_BUS_NUM); +#endif
switch (argc) { case 2: /* set date & time */ @@ -94,7 +99,11 @@ int do_date (cmd_tbl_t *cmdtp, int flag, }
/* switch back to original I2C bus */ +#ifdef CONFIG_NEW_I2C
- i2c_set_bus_num(old_bus);
+#else I2C_SET_BUS(old_bus); +#endif
Just a global note:
This makes no sense to me. If we assume that the new code works, then it will replace the old code. These #ifdef's make no sense.
We will probably hold this code in some testing branch (for a longer period of time to allow for extensive testing), but I don;t see the need to support both the old and the new code at the same time. This makes the code and your patches only more difficult to read.
Best regards,
Wolfgang Denk