diff options
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, | |||
173 | unsigned segment; | 173 | unsigned segment; |
174 | unsigned offset = (unsigned) off; | 174 | unsigned offset = (unsigned) off; |
175 | u8 *cp = bounce + 1; | 175 | u8 *cp = bounce + 1; |
176 | int sr; | ||
176 | 177 | ||
177 | *cp = AT25_WREN; | 178 | *cp = AT25_WREN; |
178 | status = spi_write(at25->spi, cp, 1); | 179 | status = spi_write(at25->spi, cp, 1); |
@@ -214,7 +215,6 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off, | |||
214 | timeout = jiffies + msecs_to_jiffies(EE_TIMEOUT); | 215 | timeout = jiffies + msecs_to_jiffies(EE_TIMEOUT); |
215 | retries = 0; | 216 | retries = 0; |
216 | do { | 217 | do { |
217 | int sr; | ||
218 | 218 | ||
219 | sr = spi_w8r8(at25->spi, AT25_RDSR); | 219 | sr = spi_w8r8(at25->spi, AT25_RDSR); |
220 | if (sr < 0 || (sr & AT25_SR_nRDY)) { | 220 | if (sr < 0 || (sr & AT25_SR_nRDY)) { |
@@ -228,7 +228,7 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off, | |||
228 | break; | 228 | break; |
229 | } while (retries++ < 3 || time_before_eq(jiffies, timeout)); | 229 | } while (retries++ < 3 || time_before_eq(jiffies, timeout)); |
230 | 230 | ||
231 | if (time_after(jiffies, timeout)) { | 231 | if ((sr < 0) || (sr & AT25_SR_nRDY)) { |
232 | dev_err(&at25->spi->dev, | 232 | dev_err(&at25->spi->dev, |
233 | "write %d bytes offset %d, " | 233 | "write %d bytes offset %d, " |
234 | "timeout after %u msecs\n", | 234 | "timeout after %u msecs\n", |