summaryrefslogtreecommitdiff
path: root/nandwrite.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2011-08-19 10:07:52 -0700
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-08-23 09:27:49 +0300
commit40a989d1ae5b18f68f43de739c8e15fa6734a9e2 (patch)
tree7e1e123c272163542af6eb8423ef04614be1f097 /nandwrite.c
parentc20007ec9f9cd325c1dfb103a409b2ef18bf85d7 (diff)
nandwrite: kill more MEMSETOOBSEL
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'nandwrite.c')
-rw-r--r--nandwrite.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/nandwrite.c b/nandwrite.c
index 21e00a2..a73a524 100644
--- a/nandwrite.c
+++ b/nandwrite.c
@@ -44,10 +44,6 @@
#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