x86: fix MTD API usage in the RDC specific board patch
authorGabor Juhos <juhosg@openwrt.org>
Sun, 23 Feb 2014 21:15:56 +0000 (21:15 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 23 Feb 2014 21:15:56 +0000 (21:15 +0000)
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 39734

target/linux/x86/patches-3.10/100-rdc_boards.patch

index 6b8fe6c..3712cb8 100644 (file)
 +late_initcall(rdc_board_setup);
 --- /dev/null
 +++ b/arch/x86/mach-rdc321x/boards/ar525w.c
-@@ -0,0 +1,247 @@
+@@ -0,0 +1,251 @@
 +/*
 + * ar525w RDC321x platform devices
 + *
 +              return -ENOMEM;
 +      }
 +
-+      res =  master->read(master, 0x0, bufferlength, &len, buffer);
++      res =  mtd_read(master, 0x0, bufferlength, &len, buffer);
 +      if (res || len != bufferlength)
 +              goto out;
 +
 +      header->fastcksum = crc32(crcbuf, sizeof(crcbuf));
 +      header->checksum = crc32(buffer, bufferlength);
 +
-+      if (master->unlock)
-+              master->unlock(master, 0, master->erasesize);
++      res = mtd_unlock(master, 0, master->erasesize);
++      if (res != 0 && res != -EOPNOTSUPP) {
++              printk(KERN_ERR "Can't unlock image header\n");
++              goto out;
++      }
++
 +      res = erase_write (master, 0, master->erasesize, buffer);
 +      if (res)
 +              printk(KERN_ERR "Can't rewrite image header\n");
 +      if (master->size != 0x400000) //4MB
 +              return -ENOSYS;
 +
-+      res =  master->read(master, 0x0, sizeof(header), &len, (char *)&header);
++      res =  mtd_read(master, 0x0, sizeof(header), &len, (char *)&header);
 +      if (res)
 +              return res;
 +
 +      u32 kernel_len;
 +      u16 tmp;
 +
-+      res =  master->read(master, 0x4000 + 1036, 2, &len, (char *) &tmp);
++      res =  mtd_read(master, 0x4000 + 1036, 2, &len, (char *) &tmp);
 +      if (res)
 +              return res;
 +      kernel_len = tmp * master->erasesize;
 +      if (master->size != 0x400000) /* 4MB */
 +              return -ENOSYS;
 +
-+      res =  master->read(master, 0x8000, sizeof(header), &len, (char *)&header);
++      res =  mtd_read(master, 0x8000, sizeof(header), &len, (char *)&header);
 +      if (res)
 +              return res;
 +