From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] 1/12 Multiadapter/multibus I2C, common part 1
Date: Mon, 16 Feb 2009 22:34:52 +0100 [thread overview]
Message-ID: <20090216213452.040C0832E893@gemini.denx.de> (raw)
In-Reply-To: <Pine.LNX.4.64ksi.0902121409460.21067@home-gw.koi8.net>
Dear ksi at 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
--
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: wd at 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"
next prev parent reply other threads:[~2009-02-16 21:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 22:12 [U-Boot] [PATCH] 1/12 Multiadapter/multibus I2C, common part 1 ksi at koi8.net
2009-02-13 8:03 ` Heiko Schocher
2009-02-13 17:51 ` Jon Loeliger
2009-02-14 8:24 ` Heiko Schocher
2009-02-16 21:36 ` Wolfgang Denk
2009-02-16 21:34 ` Wolfgang Denk [this message]
2009-02-17 6:04 ` ksi at koi8.net
2009-02-16 21:38 ` Wolfgang Denk
2009-02-17 18:25 ` ksi at koi8.net
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090216213452.040C0832E893@gemini.denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox