Dear k...@koi8.net, In message <pine.lnx.4.64ksi.0902121409460.21...@home-gw.koi8.net> you wrote: > Signed-off-by: Sergey Kubushyn <k...@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 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de The manager will be continually amazed that policies he took for com- mon knowledge are totally unknown by some member of his team. Since his fundamental job is to keep everybody going in the same direction, his chief daily task will be communication, not decision-making. - Fred Brooks, "The Mythical Man Month" _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot