]> www.infradead.org Git - mtd-utils.git/commitdiff
nandwrite: kill more MEMSETOOBSEL
authorBrian Norris <computersforpeace@gmail.com>
Fri, 19 Aug 2011 17:07:52 +0000 (10:07 -0700)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Tue, 23 Aug 2011 06:27:49 +0000 (09:27 +0300)
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
nandwrite.c

index 21e00a2e584e9e1719ddc5a61e2afec9db49c949..a73a524947adbd5dc2bd22639128e3e2e160881c 100644 (file)
 #include <libmtd.h>
 
 // oob layouts to pass into the kernel as default
-static struct nand_oobinfo none_oobinfo = {
-       .useecc = MTD_NANDECC_OFF,
-};
-
 static struct nand_oobinfo jffs2_oobinfo = {
        .useecc = MTD_NANDECC_PLACE,
        .eccbytes = 6,
@@ -318,18 +314,7 @@ int main(int argc, char * const argv[])
                } else {
                        switch (errno) {
                        case ENOTTY:
-                               if (ioctl(fd, MEMGETOOBSEL, &old_oobinfo) != 0) {
-                                       perror("MEMGETOOBSEL");
-                                       close(fd);
-                                       exit(EXIT_FAILURE);
-                               }
-                               if (ioctl(fd, MEMSETOOBSEL, &none_oobinfo) != 0) {
-                                       perror("MEMSETOOBSEL");
-                                       close(fd);
-                                       exit(EXIT_FAILURE);
-                               }
-                               oobinfochanged = 1;
-                               break;
+                               errmsg_die("ioctl MTDFILEMODE is missing");
                        default:
                                perror("MTDFILEMODE");
                                close(fd);
@@ -670,15 +655,6 @@ restoreoob:
        libmtd_close(mtd_desc);
        free(filebuf);
        free(oobbuf);
-
-       if (oobinfochanged == 1) {
-               if (ioctl(fd, MEMSETOOBSEL, &old_oobinfo) != 0) {
-                       perror("MEMSETOOBSEL");
-                       close(fd);
-                       exit(EXIT_FAILURE);
-               }
-       }
-
        close(fd);
 
        if (failed