Dear Stefano, In message <[email protected]> you wrote: > > I think it relies on the fact that only one of the two PMICs is mounted > on the board. There are versions of the board with the Dialog PMIC, and > other versions with Frescale's. Worse it is, there is no easy way to > detect which version of the board is running.
The code should be fixed anyway - it is trivial to rewrite such that there are no problems even if both branches would be executed. Please note that the test is a plain i2c_probe(), so any other I2C device you may attach to such a board can cause a false positive here. Thinking again about this, the approach of using i2c_probe() is kind of questionable. > However, only one of the two branch can run, because i2c_probe() fails > if the PMIC is not found. Who guarantees that no other I2C device has been attached that uses the "free" address? > Agree, but physically not possible, until Freescale decides to mount > both PMICs on the mx53loco...(but this is a nonsense) The needed change is small, and defensive programming has always been a good idea. Please let's have this fixed. 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: [email protected] "Here's a fish hangs in the net like a poor man's right in the law. 'Twill hardly come out." - Shakespeare, Pericles, Act II, Scene 1 _______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

