diff options
author | Eric Bénard <eric@eukrea.com> | 2012-08-28 23:58:08 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-08-29 09:03:18 +0200 |
commit | 00dfde27424d7ce1ae662ee7d4b9d636574f5421 (patch) | |
tree | 4d1f7bffc8b80aec9b6cd8828e21117255324b0f /drivers | |
parent | 0d6aa9a82bd6e307b777a86997cc99d061d61e59 (diff) | |
download | barebox-00dfde27424d7ce1ae662ee7d4b9d636574f5421.tar.gz barebox-00dfde27424d7ce1ae662ee7d4b9d636574f5421.tar.xz |
m25p80: wait for flash before returning after erase
else when we do "erase /dev/m25p0.rootfs; reset", the board
will never reboot as the flash is busy to finish the erase
command.
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nor/m25p80.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nor/m25p80.c b/drivers/nor/m25p80.c index daaf60c321..5713ad58fe 100644 --- a/drivers/nor/m25p80.c +++ b/drivers/nor/m25p80.c @@ -257,6 +257,9 @@ static ssize_t m25p80_erase(struct cdev *cdev, size_t count, loff_t offset) } } + if (wait_till_ready(flash)) + return -ETIMEDOUT; + return 0; } @@ -684,7 +687,6 @@ static const struct spi_device_id *jedec_probe(struct spi_device *spi) return NULL; } - static struct file_operations m25p80_ops = { .read = m25p80_read, .write = m25p80_write, |