In message <[EMAIL PROTECTED]> you wrote: > This patch adds a new sub command to eeprom called "info". This allows eeprom > driver writers to implement a way of querying the device. For example, SPI > flashes have status commands, jedec ids, part ids, and other fun stuff. It's > useful to be able to quickly probe this data (so you know things are detected > properly and all that jazz).
How is this suppoesed to work on the "normal" EEPROm devices which are typically attached to the I2C bus? > I made the function weak so that people aren't required to implement this > function (mostly so that it does not break all the SPI drivers out there right > now). ... and I2C. > +extern int eeprom_info (void) __attribute__((weak)); > #if defined(CFG_EEPROM_WREN) > extern int eeprom_write_enable (unsigned dev_addr, int state); > #endif > @@ -104,7 +105,8 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, > char *argv[]) > > puts ("done\n"); > return rcode; > - } > + } else if (argc == 2 && eeprom_info && strcmp (argv[1], "info") > == 0) > + return eeprom_info (); ... && eeprom_info && ...? Does that mean that a weak function resolves to a NULL pointer? Is this guaranteed? 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] The IQ of the group is the lowest IQ of a member of the group divided by the number of people in the group. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users