[PATCH 2/5] m25p80: allow erase to be interrupted
Johannes Stezenbach
js at sig21.net
Wed Jun 6 12:04:57 EDT 2012
Check for Ctrl-C before erasing each sector.
Signed-off-by: Johannes Stezenbach <js at sig21.net>
---
drivers/nor/m25p80.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/nor/m25p80.c b/drivers/nor/m25p80.c
index a3dfe75..86e6d25 100644
--- a/drivers/nor/m25p80.c
+++ b/drivers/nor/m25p80.c
@@ -232,6 +232,8 @@ static ssize_t m25p80_erase(struct cdev *cdev, size_t count, unsigned long offse
/* "sector"-at-a-time erase */
} else {
while (len) {
+ if (ctrlc())
+ return -EINTR;
if (erase_sector(flash, addr))
return -EIO;
--
1.7.10
More information about the barebox
mailing list