From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [patch] add support for "eeprom info"
Date: Wed, 23 Jan 2008 22:06:01 +0100 [thread overview]
Message-ID: <20080123210601.E1CEA247A1@gemini.denx.de> (raw)
In-Reply-To: Your message of "Wed, 23 Jan 2008 11:13:38 EST." <200801231113.38864.vapier@gentoo.org>
In message <200801231113.38864.vapier@gentoo.org> 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: wd at denx.de
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.
next prev parent reply other threads:[~2008-01-23 21:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-23 16:13 [U-Boot-Users] [patch] add support for "eeprom info" Mike Frysinger
2008-01-23 21:06 ` Wolfgang Denk [this message]
2008-01-23 21:15 ` Mike Frysinger
2008-01-23 21:23 ` Wolfgang Denk
2008-01-23 22:29 ` Mike Frysinger
2008-01-24 0:44 ` Wolfgang Denk
2008-01-24 3:39 ` Mike Frysinger
2008-01-24 4:24 ` Ben Warren
2008-01-24 5:17 ` Mike Frysinger
2008-01-24 11:13 ` Wolfgang Denk
2008-01-25 13:31 ` Mike Frysinger
2008-01-24 9:13 ` Mike Frysinger
2008-01-24 11:31 ` Wolfgang Denk
2008-01-25 13:33 ` Mike Frysinger
2008-01-25 15:09 ` Wolfgang Denk
2008-01-25 16:02 ` Mike Frysinger
2008-01-25 16:54 ` J. William Campbell
2008-01-25 17:21 ` Mike Frysinger
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=20080123210601.E1CEA247A1@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