eeprom/at25: bugfix "not ready" timeout after write
authorSebastian Heutling <heutling@who-ing.de>
Wed, 29 Jul 2009 22:04:05 +0000 (15:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 30 Jul 2009 02:10:35 +0000 (19:10 -0700)
commitf0d83679a8d471dc8b646919f70595d6fe8c9606
tree33d3f2fc1f8902c82f777f168eddce85660bb17a
parent096b7fe012d66ed55e98bc8022405ede0cc80e96
eeprom/at25: bugfix "not ready" timeout after write

Under certain circumstances msleep(1) within the loop, which waits for the
EEPROM to be finished, might take longer than the timeout.  On the next
loop the status register might now return to be ready and therefore the
loop finishes.  The following check now tests if a timeout occurred and if
so returns an error although the device reported it was ready.

This fix replaces testing the occurrence of the timeout by testing the
"not ready" bit in the status register.

Signed-off-by: Sebastian Heutling <heutling@who-ing.de>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/misc/eeprom/at25.c