erase.c

Kári Davíðsson kd at flaga.is
Mon Mar 12 16:43:54 EST 2001


Hi,

In the intel chip that we are using here all sectors seem to be locked
by default.
So in the erase utility I propose the following patch.

Maybe it is ambigous to do force unlocking of sectors like this.
Should we maybe have a separate utility to lock/unlock sectors?

K.D.

--- ../mtd/util/erase.c Thu Sep 21 22:00:07 2000
+++ util/erase.c        Mon Mar 12 14:58:58 2001
@@ -51,6 +51,12 @@
                 erase.length, erase.start);
          fflush(stdout);
 
+         if(ioctl(Fd, MEMUNLOCK, &erase) != 0)
+         {
+                 perror("\nMTD Unlock failure");
+                 close(Fd);
+                 return 8;
+                }
          if (ioctl(Fd,MEMERASE,&erase) != 0)
              {      
                  perror("\nMTD Erase failure");


To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org



More information about the linux-mtd mailing list