aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2011-08-30 21:45:40 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:28:59 -0400
commit0612b9ddc2eeda014dd805c87c752b342d8f80f0 (patch)
tree7691ee548ab6da1e7df946a75abd96a814208d8e /drivers/mtd
parent905c6bcdb42616da717a9bd6c0c5870dbd90b09e (diff)
mtd: rename MTD_OOB_* to MTD_OPS_*
These modes are not necessarily for OOB only. Particularly, MTD_OOB_RAW affected operations on in-band page data as well. To clarify these options and to emphasize that their effect is applied per-operation, we change the primary prefix to MTD_OPS_. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/devices/doc2000.c4
-rw-r--r--drivers/mtd/devices/doc2001.c4
-rw-r--r--drivers/mtd/devices/doc2001plus.c4
-rw-r--r--drivers/mtd/inftlcore.c6
-rw-r--r--drivers/mtd/mtdchar.c10
-rw-r--r--drivers/mtd/mtdpart.c2
-rw-r--r--drivers/mtd/mtdswap.c6
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c2
-rw-r--r--drivers/mtd/nand/nand_base.c40
-rw-r--r--drivers/mtd/nand/nand_bbt.c8
-rw-r--r--drivers/mtd/nand/sm_common.c2
-rw-r--r--drivers/mtd/nftlcore.c6
-rw-r--r--drivers/mtd/onenand/onenand_base.c38
-rw-r--r--drivers/mtd/onenand/onenand_bbt.c2
-rw-r--r--drivers/mtd/sm_ftl.c4
-rw-r--r--drivers/mtd/ssfdc.c2
-rw-r--r--drivers/mtd/tests/mtd_oobtest.c24
-rw-r--r--drivers/mtd/tests/mtd_readtest.c2
18 files changed, 84 insertions, 82 deletions
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
index 8c9703309496..e9fad9151219 100644
--- a/drivers/mtd/devices/doc2000.c
+++ b/drivers/mtd/devices/doc2000.c
@@ -927,7 +927,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs,
927 uint8_t *buf = ops->oobbuf; 927 uint8_t *buf = ops->oobbuf;
928 size_t len = ops->len; 928 size_t len = ops->len;
929 929
930 BUG_ON(ops->mode != MTD_OOB_PLACE); 930 BUG_ON(ops->mode != MTD_OPS_PLACE_OOB);
931 931
932 ofs += ops->ooboffs; 932 ofs += ops->ooboffs;
933 933
@@ -1091,7 +1091,7 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
1091 struct DiskOnChip *this = mtd->priv; 1091 struct DiskOnChip *this = mtd->priv;
1092 int ret; 1092 int ret;
1093 1093
1094 BUG_ON(ops->mode != MTD_OOB_PLACE); 1094 BUG_ON(ops->mode != MTD_OPS_PLACE_OOB);
1095 1095
1096 mutex_lock(&this->lock); 1096 mutex_lock(&this->lock);
1097 ret = doc_write_oob_nolock(mtd, ofs + ops->ooboffs, ops->len, 1097 ret = doc_write_oob_nolock(mtd, ofs + ops->ooboffs, ops->len,
diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c
index 3d2b459cea92..a3f7a27499be 100644
--- a/drivers/mtd/devices/doc2001.c
+++ b/drivers/mtd/devices/doc2001.c
@@ -631,7 +631,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs,
631 uint8_t *buf = ops->oobbuf; 631 uint8_t *buf = ops->oobbuf;
632 size_t len = ops->len; 632 size_t len = ops->len;
633 633
634 BUG_ON(ops->mode != MTD_OOB_PLACE); 634 BUG_ON(ops->mode != MTD_OPS_PLACE_OOB);
635 635
636 ofs += ops->ooboffs; 636 ofs += ops->ooboffs;
637 637
@@ -689,7 +689,7 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
689 uint8_t *buf = ops->oobbuf; 689 uint8_t *buf = ops->oobbuf;
690 size_t len = ops->len; 690 size_t len = ops->len;
691 691
692 BUG_ON(ops->mode != MTD_OOB_PLACE); 692 BUG_ON(ops->mode != MTD_OPS_PLACE_OOB);
693 693
694 ofs += ops->ooboffs; 694 ofs += ops->ooboffs;
695 695
diff --git a/drivers/mtd/devices/doc2001plus.c b/drivers/mtd/devices/doc2001plus.c
index d28c9d99979f..99351bc3e0ed 100644
--- a/drivers/mtd/devices/doc2001plus.c
+++ b/drivers/mtd/devices/doc2001plus.c
@@ -834,7 +834,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs,
834 uint8_t *buf = ops->oobbuf; 834 uint8_t *buf = ops->oobbuf;
835 size_t len = ops->len; 835 size_t len = ops->len;
836 836
837 BUG_ON(ops->mode != MTD_OOB_PLACE); 837 BUG_ON(ops->mode != MTD_OPS_PLACE_OOB);
838 838
839 ofs += ops->ooboffs; 839 ofs += ops->ooboffs;
840 840
@@ -919,7 +919,7 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs,
919 uint8_t *buf = ops->oobbuf; 919 uint8_t *buf = ops->oobbuf;
920 size_t len = ops->len; 920 size_t len = ops->len;
921 921
922 BUG_ON(ops->mode != MTD_OOB_PLACE); 922 BUG_ON(ops->mode != MTD_OPS_PLACE_OOB);
923 923
924 ofs += ops->ooboffs; 924 ofs += ops->ooboffs;
925 925
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
index 21aa981e42cd..652065e47a79 100644
--- a/drivers/mtd/inftlcore.c
+++ b/drivers/mtd/inftlcore.c
@@ -152,7 +152,7 @@ int inftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
152 struct mtd_oob_ops ops; 152 struct mtd_oob_ops ops;
153 int res; 153 int res;
154 154
155 ops.mode = MTD_OOB_PLACE; 155 ops.mode = MTD_OPS_PLACE_OOB;
156 ops.ooboffs = offs & (mtd->writesize - 1); 156 ops.ooboffs = offs & (mtd->writesize - 1);
157 ops.ooblen = len; 157 ops.ooblen = len;
158 ops.oobbuf = buf; 158 ops.oobbuf = buf;
@@ -172,7 +172,7 @@ int inftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
172 struct mtd_oob_ops ops; 172 struct mtd_oob_ops ops;
173 int res; 173 int res;
174 174
175 ops.mode = MTD_OOB_PLACE; 175 ops.mode = MTD_OPS_PLACE_OOB;
176 ops.ooboffs = offs & (mtd->writesize - 1); 176 ops.ooboffs = offs & (mtd->writesize - 1);
177 ops.ooblen = len; 177 ops.ooblen = len;
178 ops.oobbuf = buf; 178 ops.oobbuf = buf;
@@ -192,7 +192,7 @@ static int inftl_write(struct mtd_info *mtd, loff_t offs, size_t len,
192 struct mtd_oob_ops ops; 192 struct mtd_oob_ops ops;
193 int res; 193 int res;
194 194
195 ops.mode = MTD_OOB_PLACE; 195 ops.mode = MTD_OPS_PLACE_OOB;
196 ops.ooboffs = offs; 196 ops.ooboffs = offs;
197 ops.ooblen = mtd->oobsize; 197 ops.ooblen = mtd->oobsize;
198 ops.oobbuf = oob; 198 ops.oobbuf = oob;
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index d0eaef67b9bb..9b76438a3c27 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -221,7 +221,7 @@ static ssize_t mtd_read(struct file *file, char __user *buf, size_t count,loff_t
221 { 221 {
222 struct mtd_oob_ops ops; 222 struct mtd_oob_ops ops;
223 223
224 ops.mode = MTD_OOB_RAW; 224 ops.mode = MTD_OPS_RAW;
225 ops.datbuf = kbuf; 225 ops.datbuf = kbuf;
226 ops.oobbuf = NULL; 226 ops.oobbuf = NULL;
227 ops.len = len; 227 ops.len = len;
@@ -317,7 +317,7 @@ static ssize_t mtd_write(struct file *file, const char __user *buf, size_t count
317 { 317 {
318 struct mtd_oob_ops ops; 318 struct mtd_oob_ops ops;
319 319
320 ops.mode = MTD_OOB_RAW; 320 ops.mode = MTD_OPS_RAW;
321 ops.datbuf = kbuf; 321 ops.datbuf = kbuf;
322 ops.oobbuf = NULL; 322 ops.oobbuf = NULL;
323 ops.ooboffs = 0; 323 ops.ooboffs = 0;
@@ -413,7 +413,8 @@ static int mtd_do_writeoob(struct file *file, struct mtd_info *mtd,
413 ops.ooblen = length; 413 ops.ooblen = length;
414 ops.ooboffs = start & (mtd->writesize - 1); 414 ops.ooboffs = start & (mtd->writesize - 1);
415 ops.datbuf = NULL; 415 ops.datbuf = NULL;
416 ops.mode = (mfi->mode == MTD_MODE_RAW) ? MTD_OOB_RAW : MTD_OOB_PLACE; 416 ops.mode = (mfi->mode == MTD_MODE_RAW) ? MTD_OPS_RAW :
417 MTD_OPS_PLACE_OOB;
417 418
418 if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs)) 419 if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs))
419 return -EINVAL; 420 return -EINVAL;
@@ -457,7 +458,8 @@ static int mtd_do_readoob(struct file *file, struct mtd_info *mtd,
457 ops.ooblen = length; 458 ops.ooblen = length;
458 ops.ooboffs = start & (mtd->writesize - 1); 459 ops.ooboffs = start & (mtd->writesize - 1);
459 ops.datbuf = NULL; 460 ops.datbuf = NULL;
460 ops.mode = (mfi->mode == MTD_MODE_RAW) ? MTD_OOB_RAW : MTD_OOB_PLACE; 461 ops.mode = (mfi->mode == MTD_MODE_RAW) ? MTD_OPS_RAW :
462 MTD_OPS_PLACE_OOB;
461 463
462 if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs)) 464 if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs))
463 return -EINVAL; 465 return -EINVAL;
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index c90b7ba362d7..cd7785aa1649 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -130,7 +130,7 @@ static int part_read_oob(struct mtd_info *mtd, loff_t from,
130 if (ops->oobbuf) { 130 if (ops->oobbuf) {
131 size_t len, pages; 131 size_t len, pages;
132 132
133 if (ops->mode == MTD_OOB_AUTO) 133 if (ops->mode == MTD_OPS_AUTO_OOB)
134 len = mtd->oobavail; 134 len = mtd->oobavail;
135 else 135 else
136 len = mtd->oobsize; 136 len = mtd->oobsize;
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
index 9961063b90a2..910309f260f8 100644
--- a/drivers/mtd/mtdswap.c
+++ b/drivers/mtd/mtdswap.c
@@ -350,7 +350,7 @@ static int mtdswap_read_markers(struct mtdswap_dev *d, struct swap_eb *eb)
350 ops.oobbuf = d->oob_buf; 350 ops.oobbuf = d->oob_buf;
351 ops.ooboffs = 0; 351 ops.ooboffs = 0;
352 ops.datbuf = NULL; 352 ops.datbuf = NULL;
353 ops.mode = MTD_OOB_AUTO; 353 ops.mode = MTD_OPS_AUTO_OOB;
354 354
355 ret = mtdswap_read_oob(d, offset, &ops); 355 ret = mtdswap_read_oob(d, offset, &ops);
356 356
@@ -389,7 +389,7 @@ static int mtdswap_write_marker(struct mtdswap_dev *d, struct swap_eb *eb,
389 389
390 ops.ooboffs = 0; 390 ops.ooboffs = 0;
391 ops.oobbuf = (uint8_t *)&n; 391 ops.oobbuf = (uint8_t *)&n;
392 ops.mode = MTD_OOB_AUTO; 392 ops.mode = MTD_OPS_AUTO_OOB;
393 ops.datbuf = NULL; 393 ops.datbuf = NULL;
394 394
395 if (marker == MTDSWAP_TYPE_CLEAN) { 395 if (marker == MTDSWAP_TYPE_CLEAN) {
@@ -931,7 +931,7 @@ static unsigned int mtdswap_eblk_passes(struct mtdswap_dev *d,
931 struct mtd_oob_ops ops; 931 struct mtd_oob_ops ops;
932 int ret; 932 int ret;
933 933
934 ops.mode = MTD_OOB_AUTO; 934 ops.mode = MTD_OPS_AUTO_OOB;
935 ops.len = mtd->writesize; 935 ops.len = mtd->writesize;
936 ops.ooblen = mtd->ecclayout->oobavail; 936 ops.ooblen = mtd->ecclayout->oobavail;
937 ops.ooboffs = 0; 937 ops.ooboffs = 0;
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 5c0fe0dd7057..071b63420f0e 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1104,7 +1104,7 @@ gpmi_ecc_write_oob(struct mtd_info *mtd, struct nand_chip *chip, int page)
1104 * The BCH will use all the (page + oob). 1104 * The BCH will use all the (page + oob).
1105 * Our gpmi_hw_ecclayout can only prohibit the JFFS2 to write the oob. 1105 * Our gpmi_hw_ecclayout can only prohibit the JFFS2 to write the oob.
1106 * But it can not stop some ioctls such MEMWRITEOOB which uses 1106 * But it can not stop some ioctls such MEMWRITEOOB which uses
1107 * MTD_OOB_PLACE. So We have to implement this function to prohibit 1107 * MTD_OPS_PLACE_OOB. So We have to implement this function to prohibit
1108 * these ioctls too. 1108 * these ioctls too.
1109 */ 1109 */
1110 return -EPERM; 1110 return -EPERM;
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ad40607f5f24..686b55770113 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1382,12 +1382,12 @@ static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
1382{ 1382{
1383 switch (ops->mode) { 1383 switch (ops->mode) {
1384 1384
1385 case MTD_OOB_PLACE: 1385 case MTD_OPS_PLACE_OOB:
1386 case MTD_OOB_RAW: 1386 case MTD_OPS_RAW:
1387 memcpy(oob, chip->oob_poi + ops->ooboffs, len); 1387 memcpy(oob, chip->oob_poi + ops->ooboffs, len);
1388 return oob + len; 1388 return oob + len;
1389 1389
1390 case MTD_OOB_AUTO: { 1390 case MTD_OPS_AUTO_OOB: {
1391 struct nand_oobfree *free = chip->ecc.layout->oobfree; 1391 struct nand_oobfree *free = chip->ecc.layout->oobfree;
1392 uint32_t boffs = 0, roffs = ops->ooboffs; 1392 uint32_t boffs = 0, roffs = ops->ooboffs;
1393 size_t bytes = 0; 1393 size_t bytes = 0;
@@ -1437,7 +1437,7 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
1437 int ret = 0; 1437 int ret = 0;
1438 uint32_t readlen = ops->len; 1438 uint32_t readlen = ops->len;
1439 uint32_t oobreadlen = ops->ooblen; 1439 uint32_t oobreadlen = ops->ooblen;
1440 uint32_t max_oobsize = ops->mode == MTD_OOB_AUTO ? 1440 uint32_t max_oobsize = ops->mode == MTD_OPS_AUTO_OOB ?
1441 mtd->oobavail : mtd->oobsize; 1441 mtd->oobavail : mtd->oobsize;
1442 1442
1443 uint8_t *bufpoi, *oob, *buf; 1443 uint8_t *bufpoi, *oob, *buf;
@@ -1469,7 +1469,7 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
1469 } 1469 }
1470 1470
1471 /* Now read the page into the buffer */ 1471 /* Now read the page into the buffer */
1472 if (unlikely(ops->mode == MTD_OOB_RAW)) 1472 if (unlikely(ops->mode == MTD_OPS_RAW))
1473 ret = chip->ecc.read_page_raw(mtd, chip, 1473 ret = chip->ecc.read_page_raw(mtd, chip,
1474 bufpoi, page); 1474 bufpoi, page);
1475 else if (!aligned && NAND_SUBPAGE_READ(chip) && !oob) 1475 else if (!aligned && NAND_SUBPAGE_READ(chip) && !oob)
@@ -1759,7 +1759,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
1759 1759
1760 stats = mtd->ecc_stats; 1760 stats = mtd->ecc_stats;
1761 1761
1762 if (ops->mode == MTD_OOB_AUTO) 1762 if (ops->mode == MTD_OPS_AUTO_OOB)
1763 len = chip->ecc.layout->oobavail; 1763 len = chip->ecc.layout->oobavail;
1764 else 1764 else
1765 len = mtd->oobsize; 1765 len = mtd->oobsize;
@@ -1787,7 +1787,7 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
1787 page = realpage & chip->pagemask; 1787 page = realpage & chip->pagemask;
1788 1788
1789 while (1) { 1789 while (1) {
1790 if (ops->mode == MTD_OOB_RAW) 1790 if (ops->mode == MTD_OPS_RAW)
1791 sndcmd = chip->ecc.read_oob_raw(mtd, chip, page, sndcmd); 1791 sndcmd = chip->ecc.read_oob_raw(mtd, chip, page, sndcmd);
1792 else 1792 else
1793 sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd); 1793 sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
@@ -1865,9 +1865,9 @@ static int nand_read_oob(struct mtd_info *mtd, loff_t from,
1865 nand_get_device(chip, mtd, FL_READING); 1865 nand_get_device(chip, mtd, FL_READING);
1866 1866
1867 switch (ops->mode) { 1867 switch (ops->mode) {
1868 case MTD_OOB_PLACE: 1868 case MTD_OPS_PLACE_OOB:
1869 case MTD_OOB_AUTO: 1869 case MTD_OPS_AUTO_OOB:
1870 case MTD_OOB_RAW: 1870 case MTD_OPS_RAW:
1871 break; 1871 break;
1872 1872
1873 default: 1873 default:
@@ -2113,12 +2113,12 @@ static uint8_t *nand_fill_oob(struct mtd_info *mtd, uint8_t *oob, size_t len,
2113 2113
2114 switch (ops->mode) { 2114 switch (ops->mode) {
2115 2115
2116 case MTD_OOB_PLACE: 2116 case MTD_OPS_PLACE_OOB:
2117 case MTD_OOB_RAW: 2117 case MTD_OPS_RAW:
2118 memcpy(chip->oob_poi + ops->ooboffs, oob, len); 2118 memcpy(chip->oob_poi + ops->ooboffs, oob, len);
2119 return oob + len; 2119 return oob + len;
2120 2120
2121 case MTD_OOB_AUTO: { 2121 case MTD_OPS_AUTO_OOB: {
2122 struct nand_oobfree *free = chip->ecc.layout->oobfree; 2122 struct nand_oobfree *free = chip->ecc.layout->oobfree;
2123 uint32_t boffs = 0, woffs = ops->ooboffs; 2123 uint32_t boffs = 0, woffs = ops->ooboffs;
2124 size_t bytes = 0; 2124 size_t bytes = 0;
@@ -2167,7 +2167,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
2167 uint32_t writelen = ops->len; 2167 uint32_t writelen = ops->len;
2168 2168
2169 uint32_t oobwritelen = ops->ooblen; 2169 uint32_t oobwritelen = ops->ooblen;
2170 uint32_t oobmaxlen = ops->mode == MTD_OOB_AUTO ? 2170 uint32_t oobmaxlen = ops->mode == MTD_OPS_AUTO_OOB ?
2171 mtd->oobavail : mtd->oobsize; 2171 mtd->oobavail : mtd->oobsize;
2172 2172
2173 uint8_t *oob = ops->oobbuf; 2173 uint8_t *oob = ops->oobbuf;
@@ -2236,7 +2236,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
2236 } 2236 }
2237 2237
2238 ret = chip->write_page(mtd, chip, wbuf, page, cached, 2238 ret = chip->write_page(mtd, chip, wbuf, page, cached,
2239 (ops->mode == MTD_OOB_RAW)); 2239 (ops->mode == MTD_OPS_RAW));
2240 if (ret) 2240 if (ret)
2241 break; 2241 break;
2242 2242
@@ -2356,7 +2356,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
2356 pr_debug("%s: to = 0x%08x, len = %i\n", 2356 pr_debug("%s: to = 0x%08x, len = %i\n",
2357 __func__, (unsigned int)to, (int)ops->ooblen); 2357 __func__, (unsigned int)to, (int)ops->ooblen);
2358 2358
2359 if (ops->mode == MTD_OOB_AUTO) 2359 if (ops->mode == MTD_OPS_AUTO_OOB)
2360 len = chip->ecc.layout->oobavail; 2360 len = chip->ecc.layout->oobavail;
2361 else 2361 else
2362 len = mtd->oobsize; 2362 len = mtd->oobsize;
@@ -2408,7 +2408,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
2408 2408
2409 nand_fill_oob(mtd, ops->oobbuf, ops->ooblen, ops); 2409 nand_fill_oob(mtd, ops->oobbuf, ops->ooblen, ops);
2410 2410
2411 if (ops->mode == MTD_OOB_RAW) 2411 if (ops->mode == MTD_OPS_RAW)
2412 status = chip->ecc.write_oob_raw(mtd, chip, page & chip->pagemask); 2412 status = chip->ecc.write_oob_raw(mtd, chip, page & chip->pagemask);
2413 else 2413 else
2414 status = chip->ecc.write_oob(mtd, chip, page & chip->pagemask); 2414 status = chip->ecc.write_oob(mtd, chip, page & chip->pagemask);
@@ -2445,9 +2445,9 @@ static int nand_write_oob(struct mtd_info *mtd, loff_t to,
2445 nand_get_device(chip, mtd, FL_WRITING); 2445 nand_get_device(chip, mtd, FL_WRITING);
2446 2446
2447 switch (ops->mode) { 2447 switch (ops->mode) {
2448 case MTD_OOB_PLACE: 2448 case MTD_OPS_PLACE_OOB:
2449 case MTD_OOB_AUTO: 2449 case MTD_OPS_AUTO_OOB:
2450 case MTD_OOB_RAW: 2450 case MTD_OPS_RAW:
2451 break; 2451 break;
2452 2452
2453 default: 2453 default:
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 6aa8125772b8..c488bcb84c90 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -302,7 +302,7 @@ static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
302 struct mtd_oob_ops ops; 302 struct mtd_oob_ops ops;
303 int res; 303 int res;
304 304
305 ops.mode = MTD_OOB_RAW; 305 ops.mode = MTD_OPS_RAW;
306 ops.ooboffs = 0; 306 ops.ooboffs = 0;
307 ops.ooblen = mtd->oobsize; 307 ops.ooblen = mtd->oobsize;
308 308
@@ -350,7 +350,7 @@ static int scan_write_bbt(struct mtd_info *mtd, loff_t offs, size_t len,
350{ 350{
351 struct mtd_oob_ops ops; 351 struct mtd_oob_ops ops;
352 352
353 ops.mode = MTD_OOB_PLACE; 353 ops.mode = MTD_OPS_PLACE_OOB;
354 ops.ooboffs = 0; 354 ops.ooboffs = 0;
355 ops.ooblen = mtd->oobsize; 355 ops.ooblen = mtd->oobsize;
356 ops.datbuf = buf; 356 ops.datbuf = buf;
@@ -433,7 +433,7 @@ static int scan_block_fast(struct mtd_info *mtd, struct nand_bbt_descr *bd,
433 ops.oobbuf = buf; 433 ops.oobbuf = buf;
434 ops.ooboffs = 0; 434 ops.ooboffs = 0;
435 ops.datbuf = NULL; 435 ops.datbuf = NULL;
436 ops.mode = MTD_OOB_PLACE; 436 ops.mode = MTD_OPS_PLACE_OOB;
437 437
438 for (j = 0; j < len; j++) { 438 for (j = 0; j < len; j++) {
439 /* 439 /*
@@ -672,7 +672,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
672 ops.ooblen = mtd->oobsize; 672 ops.ooblen = mtd->oobsize;
673 ops.ooboffs = 0; 673 ops.ooboffs = 0;
674 ops.datbuf = NULL; 674 ops.datbuf = NULL;
675 ops.mode = MTD_OOB_PLACE; 675 ops.mode = MTD_OPS_PLACE_OOB;
676 676
677 if (!rcode) 677 if (!rcode)
678 rcode = 0xff; 678 rcode = 0xff;
diff --git a/drivers/mtd/nand/sm_common.c b/drivers/mtd/nand/sm_common.c
index b6332e83b289..2c438ef53cf5 100644
--- a/drivers/mtd/nand/sm_common.c
+++ b/drivers/mtd/nand/sm_common.c
@@ -47,7 +47,7 @@ static int sm_block_markbad(struct mtd_info *mtd, loff_t ofs)
47 47
48 /* As long as this function is called on erase block boundaries 48 /* As long as this function is called on erase block boundaries
49 it will work correctly for 256 byte nand */ 49 it will work correctly for 256 byte nand */
50 ops.mode = MTD_OOB_PLACE; 50 ops.mode = MTD_OPS_PLACE_OOB;
51 ops.ooboffs = 0; 51 ops.ooboffs = 0;
52 ops.ooblen = mtd->oobsize; 52 ops.ooblen = mtd->oobsize;
53 ops.oobbuf = (void *)&oob; 53 ops.oobbuf = (void *)&oob;
diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
index 93d6fc68b892..272e3c03e324 100644
--- a/drivers/mtd/nftlcore.c
+++ b/drivers/mtd/nftlcore.c
@@ -147,7 +147,7 @@ int nftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len,
147 struct mtd_oob_ops ops; 147 struct mtd_oob_ops ops;
148 int res; 148 int res;
149 149
150 ops.mode = MTD_OOB_PLACE; 150 ops.mode = MTD_OPS_PLACE_OOB;
151 ops.ooboffs = offs & mask; 151 ops.ooboffs = offs & mask;
152 ops.ooblen = len; 152 ops.ooblen = len;
153 ops.oobbuf = buf; 153 ops.oobbuf = buf;
@@ -168,7 +168,7 @@ int nftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len,
168 struct mtd_oob_ops ops; 168 struct mtd_oob_ops ops;
169 int res; 169 int res;
170 170
171 ops.mode = MTD_OOB_PLACE; 171 ops.mode = MTD_OPS_PLACE_OOB;
172 ops.ooboffs = offs & mask; 172 ops.ooboffs = offs & mask;
173 ops.ooblen = len; 173 ops.ooblen = len;
174 ops.oobbuf = buf; 174 ops.oobbuf = buf;
@@ -191,7 +191,7 @@ static int nftl_write(struct mtd_info *mtd, loff_t offs, size_t len,
191 struct mtd_oob_ops ops; 191 struct mtd_oob_ops ops;
192 int res; 192 int res;
193 193
194 ops.mode = MTD_OOB_PLACE; 194 ops.mode = MTD_OPS_PLACE_OOB;
195 ops.ooboffs = offs & mask; 195 ops.ooboffs = offs & mask;
196 ops.ooblen = mtd->oobsize; 196 ops.ooblen = mtd->oobsize;
197 ops.oobbuf = oob; 197 ops.oobbuf = oob;
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 493901a59e6e..a52aa0f6b0c3 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1125,7 +1125,7 @@ static int onenand_mlc_read_ops_nolock(struct mtd_info *mtd, loff_t from,
1125 pr_debug("%s: from = 0x%08x, len = %i\n", __func__, (unsigned int)from, 1125 pr_debug("%s: from = 0x%08x, len = %i\n", __func__, (unsigned int)from,
1126 (int)len); 1126 (int)len);
1127 1127
1128 if (ops->mode == MTD_OOB_AUTO) 1128 if (ops->mode == MTD_OPS_AUTO_OOB)
1129 oobsize = this->ecclayout->oobavail; 1129 oobsize = this->ecclayout->oobavail;
1130 else 1130 else
1131 oobsize = mtd->oobsize; 1131 oobsize = mtd->oobsize;
@@ -1170,7 +1170,7 @@ static int onenand_mlc_read_ops_nolock(struct mtd_info *mtd, loff_t from,
1170 thisooblen = oobsize - oobcolumn; 1170 thisooblen = oobsize - oobcolumn;
1171 thisooblen = min_t(int, thisooblen, ooblen - oobread); 1171 thisooblen = min_t(int, thisooblen, ooblen - oobread);
1172 1172
1173 if (ops->mode == MTD_OOB_AUTO) 1173 if (ops->mode == MTD_OPS_AUTO_OOB)
1174 onenand_transfer_auto_oob(mtd, oobbuf, oobcolumn, thisooblen); 1174 onenand_transfer_auto_oob(mtd, oobbuf, oobcolumn, thisooblen);
1175 else 1175 else
1176 this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, oobcolumn, thisooblen); 1176 this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, oobcolumn, thisooblen);
@@ -1229,7 +1229,7 @@ static int onenand_read_ops_nolock(struct mtd_info *mtd, loff_t from,
1229 pr_debug("%s: from = 0x%08x, len = %i\n", __func__, (unsigned int)from, 1229 pr_debug("%s: from = 0x%08x, len = %i\n", __func__, (unsigned int)from,
1230 (int)len); 1230 (int)len);
1231 1231
1232 if (ops->mode == MTD_OOB_AUTO) 1232 if (ops->mode == MTD_OPS_AUTO_OOB)
1233 oobsize = this->ecclayout->oobavail; 1233 oobsize = this->ecclayout->oobavail;
1234 else 1234 else
1235 oobsize = mtd->oobsize; 1235 oobsize = mtd->oobsize;
@@ -1291,7 +1291,7 @@ static int onenand_read_ops_nolock(struct mtd_info *mtd, loff_t from,
1291 thisooblen = oobsize - oobcolumn; 1291 thisooblen = oobsize - oobcolumn;
1292 thisooblen = min_t(int, thisooblen, ooblen - oobread); 1292 thisooblen = min_t(int, thisooblen, ooblen - oobread);
1293 1293
1294 if (ops->mode == MTD_OOB_AUTO) 1294 if (ops->mode == MTD_OPS_AUTO_OOB)
1295 onenand_transfer_auto_oob(mtd, oobbuf, oobcolumn, thisooblen); 1295 onenand_transfer_auto_oob(mtd, oobbuf, oobcolumn, thisooblen);
1296 else 1296 else
1297 this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, oobcolumn, thisooblen); 1297 this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, oobcolumn, thisooblen);
@@ -1363,7 +1363,7 @@ static int onenand_read_oob_nolock(struct mtd_info *mtd, loff_t from,
1363 /* Initialize return length value */ 1363 /* Initialize return length value */
1364 ops->oobretlen = 0; 1364 ops->oobretlen = 0;
1365 1365
1366 if (mode == MTD_OOB_AUTO) 1366 if (mode == MTD_OPS_AUTO_OOB)
1367 oobsize = this->ecclayout->oobavail; 1367 oobsize = this->ecclayout->oobavail;
1368 else 1368 else
1369 oobsize = mtd->oobsize; 1369 oobsize = mtd->oobsize;
@@ -1409,7 +1409,7 @@ static int onenand_read_oob_nolock(struct mtd_info *mtd, loff_t from,
1409 break; 1409 break;
1410 } 1410 }
1411 1411
1412 if (mode == MTD_OOB_AUTO) 1412 if (mode == MTD_OPS_AUTO_OOB)
1413 onenand_transfer_auto_oob(mtd, buf, column, thislen); 1413 onenand_transfer_auto_oob(mtd, buf, column, thislen);
1414 else 1414 else
1415 this->read_bufferram(mtd, ONENAND_SPARERAM, buf, column, thislen); 1415 this->read_bufferram(mtd, ONENAND_SPARERAM, buf, column, thislen);
@@ -1487,10 +1487,10 @@ static int onenand_read_oob(struct mtd_info *mtd, loff_t from,
1487 int ret; 1487 int ret;
1488 1488
1489 switch (ops->mode) { 1489 switch (ops->mode) {
1490 case MTD_OOB_PLACE: 1490 case MTD_OPS_PLACE_OOB:
1491 case MTD_OOB_AUTO: 1491 case MTD_OPS_AUTO_OOB:
1492 break; 1492 break;
1493 case MTD_OOB_RAW: 1493 case MTD_OPS_RAW:
1494 /* Not implemented yet */ 1494 /* Not implemented yet */
1495 default: 1495 default:
1496 return -EINVAL; 1496 return -EINVAL;
@@ -1908,7 +1908,7 @@ static int onenand_write_ops_nolock(struct mtd_info *mtd, loff_t to,
1908 if (!len) 1908 if (!len)
1909 return 0; 1909 return 0;
1910 1910
1911 if (ops->mode == MTD_OOB_AUTO) 1911 if (ops->mode == MTD_OPS_AUTO_OOB)
1912 oobsize = this->ecclayout->oobavail; 1912 oobsize = this->ecclayout->oobavail;
1913 else 1913 else
1914 oobsize = mtd->oobsize; 1914 oobsize = mtd->oobsize;
@@ -1945,7 +1945,7 @@ static int onenand_write_ops_nolock(struct mtd_info *mtd, loff_t to,
1945 /* We send data to spare ram with oobsize 1945 /* We send data to spare ram with oobsize
1946 * to prevent byte access */ 1946 * to prevent byte access */
1947 memset(oobbuf, 0xff, mtd->oobsize); 1947 memset(oobbuf, 0xff, mtd->oobsize);
1948 if (ops->mode == MTD_OOB_AUTO) 1948 if (ops->mode == MTD_OPS_AUTO_OOB)
1949 onenand_fill_auto_oob(mtd, oobbuf, oob, oobcolumn, thisooblen); 1949 onenand_fill_auto_oob(mtd, oobbuf, oob, oobcolumn, thisooblen);
1950 else 1950 else
1951 memcpy(oobbuf + oobcolumn, oob, thisooblen); 1951 memcpy(oobbuf + oobcolumn, oob, thisooblen);
@@ -2084,7 +2084,7 @@ static int onenand_write_oob_nolock(struct mtd_info *mtd, loff_t to,
2084 /* Initialize retlen, in case of early exit */ 2084 /* Initialize retlen, in case of early exit */
2085 ops->oobretlen = 0; 2085 ops->oobretlen = 0;
2086 2086
2087 if (mode == MTD_OOB_AUTO) 2087 if (mode == MTD_OPS_AUTO_OOB)
2088 oobsize = this->ecclayout->oobavail; 2088 oobsize = this->ecclayout->oobavail;
2089 else 2089 else
2090 oobsize = mtd->oobsize; 2090 oobsize = mtd->oobsize;
@@ -2128,7 +2128,7 @@ static int onenand_write_oob_nolock(struct mtd_info *mtd, loff_t to,
2128 /* We send data to spare ram with oobsize 2128 /* We send data to spare ram with oobsize
2129 * to prevent byte access */ 2129 * to prevent byte access */
2130 memset(oobbuf, 0xff, mtd->oobsize); 2130 memset(oobbuf, 0xff, mtd->oobsize);
2131 if (mode == MTD_OOB_AUTO) 2131 if (mode == MTD_OPS_AUTO_OOB)
2132 onenand_fill_auto_oob(mtd, oobbuf, buf, column, thislen); 2132 onenand_fill_auto_oob(mtd, oobbuf, buf, column, thislen);
2133 else 2133 else
2134 memcpy(oobbuf + column, buf, thislen); 2134 memcpy(oobbuf + column, buf, thislen);
@@ -2217,10 +2217,10 @@ static int onenand_write_oob(struct mtd_info *mtd, loff_t to,
2217 int ret; 2217 int ret;
2218 2218
2219 switch (ops->mode) { 2219 switch (ops->mode) {
2220 case MTD_OOB_PLACE: 2220 case MTD_OPS_PLACE_OOB:
2221 case MTD_OOB_AUTO: 2221 case MTD_OPS_AUTO_OOB:
2222 break; 2222 break;
2223 case MTD_OOB_RAW: 2223 case MTD_OPS_RAW:
2224 /* Not implemented yet */ 2224 /* Not implemented yet */
2225 default: 2225 default:
2226 return -EINVAL; 2226 return -EINVAL;
@@ -2603,7 +2603,7 @@ static int onenand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
2603 struct bbm_info *bbm = this->bbm; 2603 struct bbm_info *bbm = this->bbm;
2604 u_char buf[2] = {0, 0}; 2604 u_char buf[2] = {0, 0};
2605 struct mtd_oob_ops ops = { 2605 struct mtd_oob_ops ops = {
2606 .mode = MTD_OOB_PLACE, 2606 .mode = MTD_OPS_PLACE_OOB,
2607 .ooblen = 2, 2607 .ooblen = 2,
2608 .oobbuf = buf, 2608 .oobbuf = buf,
2609 .ooboffs = 0, 2609 .ooboffs = 0,
@@ -3171,7 +3171,7 @@ static int do_otp_lock(struct mtd_info *mtd, loff_t from, size_t len,
3171 this->command(mtd, ONENAND_CMD_RESET, 0, 0); 3171 this->command(mtd, ONENAND_CMD_RESET, 0, 0);
3172 this->wait(mtd, FL_RESETING); 3172 this->wait(mtd, FL_RESETING);
3173 } else { 3173 } else {
3174 ops.mode = MTD_OOB_PLACE; 3174 ops.mode = MTD_OPS_PLACE_OOB;
3175 ops.ooblen = len; 3175 ops.ooblen = len;
3176 ops.oobbuf = buf; 3176 ops.oobbuf = buf;
3177 ops.ooboffs = 0; 3177 ops.ooboffs = 0;
@@ -3677,7 +3677,7 @@ static int flexonenand_check_blocks_erased(struct mtd_info *mtd, int start, int
3677 int i, ret; 3677 int i, ret;
3678 int block; 3678 int block;
3679 struct mtd_oob_ops ops = { 3679 struct mtd_oob_ops ops = {
3680 .mode = MTD_OOB_PLACE, 3680 .mode = MTD_OPS_PLACE_OOB,
3681 .ooboffs = 0, 3681 .ooboffs = 0,
3682 .ooblen = mtd->oobsize, 3682 .ooblen = mtd->oobsize,
3683 .datbuf = NULL, 3683 .datbuf = NULL,
diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c
index 3b9a2a9573c6..09956c4fd850 100644
--- a/drivers/mtd/onenand/onenand_bbt.c
+++ b/drivers/mtd/onenand/onenand_bbt.c
@@ -80,7 +80,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
80 startblock = 0; 80 startblock = 0;
81 from = 0; 81 from = 0;
82 82
83 ops.mode = MTD_OOB_PLACE; 83 ops.mode = MTD_OPS_PLACE_OOB;
84 ops.ooblen = readlen; 84 ops.ooblen = readlen;
85 ops.oobbuf = buf; 85 ops.oobbuf = buf;
86 ops.len = ops.ooboffs = ops.retlen = ops.oobretlen = 0; 86 ops.len = ops.ooboffs = ops.retlen = ops.oobretlen = 0;
diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c
index 311a9e39a956..d927641cb0f5 100644
--- a/drivers/mtd/sm_ftl.c
+++ b/drivers/mtd/sm_ftl.c
@@ -256,7 +256,7 @@ static int sm_read_sector(struct sm_ftl *ftl,
256 if (!oob) 256 if (!oob)
257 oob = &tmp_oob; 257 oob = &tmp_oob;
258 258
259 ops.mode = ftl->smallpagenand ? MTD_OOB_RAW : MTD_OOB_PLACE; 259 ops.mode = ftl->smallpagenand ? MTD_OPS_RAW : MTD_OPS_PLACE_OOB;
260 ops.ooboffs = 0; 260 ops.ooboffs = 0;
261 ops.ooblen = SM_OOB_SIZE; 261 ops.ooblen = SM_OOB_SIZE;
262 ops.oobbuf = (void *)oob; 262 ops.oobbuf = (void *)oob;
@@ -336,7 +336,7 @@ static int sm_write_sector(struct sm_ftl *ftl,
336 if (ftl->unstable) 336 if (ftl->unstable)
337 return -EIO; 337 return -EIO;
338 338
339 ops.mode = ftl->smallpagenand ? MTD_OOB_RAW : MTD_OOB_PLACE; 339 ops.mode = ftl->smallpagenand ? MTD_OPS_RAW : MTD_OPS_PLACE_OOB;
340 ops.len = SM_SECTOR_SIZE; 340 ops.len = SM_SECTOR_SIZE;
341 ops.datbuf = buffer; 341 ops.datbuf = buffer;
342 ops.ooboffs = 0; 342 ops.ooboffs = 0;
diff --git a/drivers/mtd/ssfdc.c b/drivers/mtd/ssfdc.c
index 5f917f0a9609..976e3d28b962 100644
--- a/drivers/mtd/ssfdc.c
+++ b/drivers/mtd/ssfdc.c
@@ -169,7 +169,7 @@ static int read_raw_oob(struct mtd_info *mtd, loff_t offs, uint8_t *buf)
169 struct mtd_oob_ops ops; 169 struct mtd_oob_ops ops;
170 int ret; 170 int ret;
171 171
172 ops.mode = MTD_OOB_RAW; 172 ops.mode = MTD_OPS_RAW;
173 ops.ooboffs = 0; 173 ops.ooboffs = 0;
174 ops.ooblen = OOB_SIZE; 174 ops.ooblen = OOB_SIZE;
175 ops.oobbuf = buf; 175 ops.oobbuf = buf;
diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c
index dec92ae6111a..6bcff42296a9 100644
--- a/drivers/mtd/tests/mtd_oobtest.c
+++ b/drivers/mtd/tests/mtd_oobtest.c
@@ -131,7 +131,7 @@ static int write_eraseblock(int ebnum)
131 131
132 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { 132 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) {
133 set_random_data(writebuf, use_len); 133 set_random_data(writebuf, use_len);
134 ops.mode = MTD_OOB_AUTO; 134 ops.mode = MTD_OPS_AUTO_OOB;
135 ops.len = 0; 135 ops.len = 0;
136 ops.retlen = 0; 136 ops.retlen = 0;
137 ops.ooblen = use_len; 137 ops.ooblen = use_len;
@@ -184,7 +184,7 @@ static int verify_eraseblock(int ebnum)
184 184
185 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) { 185 for (i = 0; i < pgcnt; ++i, addr += mtd->writesize) {
186 set_random_data(writebuf, use_len); 186 set_random_data(writebuf, use_len);
187 ops.mode = MTD_OOB_AUTO; 187 ops.mode = MTD_OPS_AUTO_OOB;
188 ops.len = 0; 188 ops.len = 0;
189 ops.retlen = 0; 189 ops.retlen = 0;
190 ops.ooblen = use_len; 190 ops.ooblen = use_len;
@@ -211,7 +211,7 @@ static int verify_eraseblock(int ebnum)
211 if (use_offset != 0 || use_len < mtd->ecclayout->oobavail) { 211 if (use_offset != 0 || use_len < mtd->ecclayout->oobavail) {
212 int k; 212 int k;
213 213
214 ops.mode = MTD_OOB_AUTO; 214 ops.mode = MTD_OPS_AUTO_OOB;
215 ops.len = 0; 215 ops.len = 0;
216 ops.retlen = 0; 216 ops.retlen = 0;
217 ops.ooblen = mtd->ecclayout->oobavail; 217 ops.ooblen = mtd->ecclayout->oobavail;
@@ -276,7 +276,7 @@ static int verify_eraseblock_in_one_go(int ebnum)
276 size_t len = mtd->ecclayout->oobavail * pgcnt; 276 size_t len = mtd->ecclayout->oobavail * pgcnt;
277 277
278 set_random_data(writebuf, len); 278 set_random_data(writebuf, len);
279 ops.mode = MTD_OOB_AUTO; 279 ops.mode = MTD_OPS_AUTO_OOB;
280 ops.len = 0; 280 ops.len = 0;
281 ops.retlen = 0; 281 ops.retlen = 0;
282 ops.ooblen = len; 282 ops.ooblen = len;
@@ -507,7 +507,7 @@ static int __init mtd_oobtest_init(void)
507 addr0 += mtd->erasesize; 507 addr0 += mtd->erasesize;
508 508
509 /* Attempt to write off end of OOB */ 509 /* Attempt to write off end of OOB */
510 ops.mode = MTD_OOB_AUTO; 510 ops.mode = MTD_OPS_AUTO_OOB;
511 ops.len = 0; 511 ops.len = 0;
512 ops.retlen = 0; 512 ops.retlen = 0;
513 ops.ooblen = 1; 513 ops.ooblen = 1;
@@ -527,7 +527,7 @@ static int __init mtd_oobtest_init(void)
527 } 527 }
528 528
529 /* Attempt to read off end of OOB */ 529 /* Attempt to read off end of OOB */
530 ops.mode = MTD_OOB_AUTO; 530 ops.mode = MTD_OPS_AUTO_OOB;
531 ops.len = 0; 531 ops.len = 0;
532 ops.retlen = 0; 532 ops.retlen = 0;
533 ops.ooblen = 1; 533 ops.ooblen = 1;
@@ -551,7 +551,7 @@ static int __init mtd_oobtest_init(void)
551 "block is bad\n"); 551 "block is bad\n");
552 else { 552 else {
553 /* Attempt to write off end of device */ 553 /* Attempt to write off end of device */
554 ops.mode = MTD_OOB_AUTO; 554 ops.mode = MTD_OPS_AUTO_OOB;
555 ops.len = 0; 555 ops.len = 0;
556 ops.retlen = 0; 556 ops.retlen = 0;
557 ops.ooblen = mtd->ecclayout->oobavail + 1; 557 ops.ooblen = mtd->ecclayout->oobavail + 1;
@@ -571,7 +571,7 @@ static int __init mtd_oobtest_init(void)
571 } 571 }
572 572
573 /* Attempt to read off end of device */ 573 /* Attempt to read off end of device */
574 ops.mode = MTD_OOB_AUTO; 574 ops.mode = MTD_OPS_AUTO_OOB;
575 ops.len = 0; 575 ops.len = 0;
576 ops.retlen = 0; 576 ops.retlen = 0;
577 ops.ooblen = mtd->ecclayout->oobavail + 1; 577 ops.ooblen = mtd->ecclayout->oobavail + 1;
@@ -595,7 +595,7 @@ static int __init mtd_oobtest_init(void)
595 goto out; 595 goto out;
596 596
597 /* Attempt to write off end of device */ 597 /* Attempt to write off end of device */
598 ops.mode = MTD_OOB_AUTO; 598 ops.mode = MTD_OPS_AUTO_OOB;
599 ops.len = 0; 599 ops.len = 0;
600 ops.retlen = 0; 600 ops.retlen = 0;
601 ops.ooblen = mtd->ecclayout->oobavail; 601 ops.ooblen = mtd->ecclayout->oobavail;
@@ -615,7 +615,7 @@ static int __init mtd_oobtest_init(void)
615 } 615 }
616 616
617 /* Attempt to read off end of device */ 617 /* Attempt to read off end of device */
618 ops.mode = MTD_OOB_AUTO; 618 ops.mode = MTD_OPS_AUTO_OOB;
619 ops.len = 0; 619 ops.len = 0;
620 ops.retlen = 0; 620 ops.retlen = 0;
621 ops.ooblen = mtd->ecclayout->oobavail; 621 ops.ooblen = mtd->ecclayout->oobavail;
@@ -655,7 +655,7 @@ static int __init mtd_oobtest_init(void)
655 addr = (i + 1) * mtd->erasesize - mtd->writesize; 655 addr = (i + 1) * mtd->erasesize - mtd->writesize;
656 for (pg = 0; pg < cnt; ++pg) { 656 for (pg = 0; pg < cnt; ++pg) {
657 set_random_data(writebuf, sz); 657 set_random_data(writebuf, sz);
658 ops.mode = MTD_OOB_AUTO; 658 ops.mode = MTD_OPS_AUTO_OOB;
659 ops.len = 0; 659 ops.len = 0;
660 ops.retlen = 0; 660 ops.retlen = 0;
661 ops.ooblen = sz; 661 ops.ooblen = sz;
@@ -683,7 +683,7 @@ static int __init mtd_oobtest_init(void)
683 continue; 683 continue;
684 set_random_data(writebuf, mtd->ecclayout->oobavail * 2); 684 set_random_data(writebuf, mtd->ecclayout->oobavail * 2);
685 addr = (i + 1) * mtd->erasesize - mtd->writesize; 685 addr = (i + 1) * mtd->erasesize - mtd->writesize;
686 ops.mode = MTD_OOB_AUTO; 686 ops.mode = MTD_OPS_AUTO_OOB;
687 ops.len = 0; 687 ops.len = 0;
688 ops.retlen = 0; 688 ops.retlen = 0;
689 ops.ooblen = mtd->ecclayout->oobavail * 2; 689 ops.ooblen = mtd->ecclayout->oobavail * 2;
diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index 836792d1d60e..587e1e371c6c 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -66,7 +66,7 @@ static int read_eraseblock_by_page(int ebnum)
66 if (mtd->oobsize) { 66 if (mtd->oobsize) {
67 struct mtd_oob_ops ops; 67 struct mtd_oob_ops ops;
68 68
69 ops.mode = MTD_OOB_PLACE; 69 ops.mode = MTD_OPS_PLACE_OOB;
70 ops.len = 0; 70 ops.len = 0;
71 ops.retlen = 0; 71 ops.retlen = 0;
72 ops.ooblen = mtd->oobsize; 72 ops.ooblen = mtd->oobsize;