diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-08-05 22:10:52 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-08-05 22:10:52 +0100 |
commit | 13efdbecc65ef6ec4028551fb223dea5c5e3143c (patch) | |
tree | 634a2ce082abe3eb2a5defe0f1ddc2f3eb10f085 /drivers/misc/eeprom/at25.c | |
parent | 61f4a10cb4e9447a85245c63b3e7f46e09299fed (diff) | |
parent | 6fd210a9cc398ecbff7bcdbe220651b73b654f56 (diff) | |
download | blackbird-op-linux-13efdbecc65ef6ec4028551fb223dea5c5e3143c.tar.gz blackbird-op-linux-13efdbecc65ef6ec4028551fb223dea5c5e3143c.zip |
Merge branch 'pm-upstream/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into devel-stable
Diffstat (limited to 'drivers/misc/eeprom/at25.c')
-rw-r--r-- | drivers/misc/eeprom/at25.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index b34cb5f79eea..2e535a0ccd5e 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -173,6 +173,7 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off, unsigned segment; unsigned offset = (unsigned) off; u8 *cp = bounce + 1; + int sr; *cp = AT25_WREN; status = spi_write(at25->spi, cp, 1); @@ -214,7 +215,6 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off, timeout = jiffies + msecs_to_jiffies(EE_TIMEOUT); retries = 0; do { - int sr; sr = spi_w8r8(at25->spi, AT25_RDSR); if (sr < 0 || (sr & AT25_SR_nRDY)) { @@ -228,7 +228,7 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off, break; } while (retries++ < 3 || time_before_eq(jiffies, timeout)); - if (time_after(jiffies, timeout)) { + if ((sr < 0) || (sr & AT25_SR_nRDY)) { dev_err(&at25->spi->dev, "write %d bytes offset %d, " "timeout after %u msecs\n", |