mtd/util flash_eraseall.c,1.19,1.20
gleixner at infradead.org
gleixner at infradead.org
Tue Jan 25 09:43:56 EST 2005
Update of /home/cvs/mtd/util
In directory phoenix.infradead.org:/tmp/cvs-serv30848
Modified Files:
flash_eraseall.c
Log Message:
Fix error check. Barf only for NAND when the bad block check is not available.
Index: flash_eraseall.c
===================================================================
RCS file: /home/cvs/mtd/util/flash_eraseall.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- flash_eraseall.c 9 Dec 2004 11:06:07 -0000 1.19
+++ flash_eraseall.c 25 Jan 2005 14:43:53 -0000 1.20
@@ -134,13 +134,18 @@
if (!quiet)
printf ("\nSkipping bad block at 0x%08x\n", erase.start);
continue;
- } else if (ret == -EOPNOTSUPP) {
- fprintf(stderr, "%s: %s: Bad block check not available\n", exe_name, mtd_device);
- bbtest = 0;
} else if (ret < 0) {
- fprintf(stderr, "\n%s: %s: MTD get bad block failed: %s\n", exe_name, mtd_device, strerror(errno));
- exit(1);
- }
+ if (errno == -EOPNOTSUPP) {
+ bbtest = 0;
+ if (isNAND) {
+ fprintf(stderr, "%s: %s: Bad block check not available\n", exe_name, mtd_device);
+ exit(1);
+ }
+ } else {
+ fprintf(stderr, "\n%s: %s: MTD get bad block failed: %s\n", exe_name, mtd_device, strerror(errno));
+ exit(1);
+ }
+ }
}
if (!quiet) {
More information about the linux-mtd-cvs
mailing list