From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Mon, 16 Nov 2015 12:28:37 +0100 Subject: [U-Boot] [PATCH 10/17] eeprom: Pull out CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS In-Reply-To: <1447185213-5799-10-git-send-email-marex@denx.de> References: <1447185213-5799-1-git-send-email-marex@denx.de> <1447185213-5799-10-git-send-email-marex@denx.de> Message-ID: <5649BDE5.9060807@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Marek, Am 10.11.2015 um 20:53 schrieb Marek Vasut: > Pull this macro to the beginning of the cmd_eeprom.c and remove > another nasty ifdef from the code. Note that this is legal, since > udelay(0) changes the behavior only such that it pings the WDT if > WDT is enabled and otherwise does not wait. > > Signed-off-by: Marek Vasut > Cc: Simon Glass > Cc: Tom Rini > Cc: Heiko Schocher > --- > common/cmd_eeprom.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Heiko Schocher bye, Heiko > > diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c > index 040ab5f..8451d63 100644 > --- a/common/cmd_eeprom.c > +++ b/common/cmd_eeprom.c > @@ -29,6 +29,10 @@ > #define CONFIG_SYS_I2C_SPEED 50000 > #endif > > +#ifndef CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS > +#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 0 > +#endif > + > /* > * for CONFIG_SYS_I2C_EEPROM_ADDR_LEN == 2 (16-bit EEPROM address) offset is > * 0x000nxxxx for EEPROM address selectors at n, offset xxxx in EEPROM. > @@ -211,9 +215,7 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn > buffer += len; > offset += len; > > -#if defined(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS) > udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000); > -#endif > } > > eeprom_write_enable(dev_addr, 0); > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany