aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand
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/onenand
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/onenand')
-rw-r--r--drivers/mtd/onenand/onenand_base.c38
-rw-r--r--drivers/mtd/onenand/onenand_bbt.c2
2 files changed, 20 insertions, 20 deletions
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;