aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2012-06-22 19:35:42 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-09-29 09:52:04 -0400
commitaf69dcd3862ed174cf67637f4142c9c895862436 (patch)
treeeda129db1673e9e3651e1bfdf5b1b6efc123f464
parenta7e68834fc273930c17e3decaddc13acb87a7dce (diff)
mtd: nand: rename '_raw' BBT scan functions
None of these scanning functions use MTD_OPS_RAW mode any more, so there's really nothing 'raw' about them. Rename them to (hopefully) make the code a little clearer. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--drivers/mtd/nand/nand_bbt.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 0e928f3efaa4..9a5402e320bf 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -276,7 +276,7 @@ static int read_abs_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_desc
276} 276}
277 277
278/* BBT marker is in the first page, no OOB */ 278/* BBT marker is in the first page, no OOB */
279static int scan_read_raw_data(struct mtd_info *mtd, uint8_t *buf, loff_t offs, 279static int scan_read_data(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
280 struct nand_bbt_descr *td) 280 struct nand_bbt_descr *td)
281{ 281{
282 size_t retlen; 282 size_t retlen;
@@ -290,7 +290,7 @@ static int scan_read_raw_data(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
290} 290}
291 291
292/** 292/**
293 * scan_read_raw_oob - [GENERIC] Scan data+OOB region to buffer 293 * scan_read_oob - [GENERIC] Scan data+OOB region to buffer
294 * @mtd: MTD device structure 294 * @mtd: MTD device structure
295 * @buf: temporary buffer 295 * @buf: temporary buffer
296 * @offs: offset at which to scan 296 * @offs: offset at which to scan
@@ -300,7 +300,7 @@ static int scan_read_raw_data(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
300 * page,OOB,page,OOB,... in buf. Completes transfer and returns the "strongest" 300 * page,OOB,page,OOB,... in buf. Completes transfer and returns the "strongest"
301 * ECC condition (error or bitflip). May quit on the first (non-ECC) error. 301 * ECC condition (error or bitflip). May quit on the first (non-ECC) error.
302 */ 302 */
303static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs, 303static int scan_read_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
304 size_t len) 304 size_t len)
305{ 305{
306 struct mtd_oob_ops ops; 306 struct mtd_oob_ops ops;
@@ -330,13 +330,13 @@ static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
330 return ret; 330 return ret;
331} 331}
332 332
333static int scan_read_raw(struct mtd_info *mtd, uint8_t *buf, loff_t offs, 333static int scan_read(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
334 size_t len, struct nand_bbt_descr *td) 334 size_t len, struct nand_bbt_descr *td)
335{ 335{
336 if (td->options & NAND_BBT_NO_OOB) 336 if (td->options & NAND_BBT_NO_OOB)
337 return scan_read_raw_data(mtd, buf, offs, td); 337 return scan_read_data(mtd, buf, offs, td);
338 else 338 else
339 return scan_read_raw_oob(mtd, buf, offs, len); 339 return scan_read_oob(mtd, buf, offs, len);
340} 340}
341 341
342/* Scan write data with oob to flash */ 342/* Scan write data with oob to flash */
@@ -381,7 +381,7 @@ static void read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
381 381
382 /* Read the primary version, if available */ 382 /* Read the primary version, if available */
383 if (td->options & NAND_BBT_VERSION) { 383 if (td->options & NAND_BBT_VERSION) {
384 scan_read_raw(mtd, buf, (loff_t)td->pages[0] << this->page_shift, 384 scan_read(mtd, buf, (loff_t)td->pages[0] << this->page_shift,
385 mtd->writesize, td); 385 mtd->writesize, td);
386 td->version[0] = buf[bbt_get_ver_offs(mtd, td)]; 386 td->version[0] = buf[bbt_get_ver_offs(mtd, td)];
387 pr_info("Bad block table at page %d, version 0x%02X\n", 387 pr_info("Bad block table at page %d, version 0x%02X\n",
@@ -390,7 +390,7 @@ static void read_abs_bbts(struct mtd_info *mtd, uint8_t *buf,
390 390
391 /* Read the mirror version, if available */ 391 /* Read the mirror version, if available */
392 if (md && (md->options & NAND_BBT_VERSION)) { 392 if (md && (md->options & NAND_BBT_VERSION)) {
393 scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift, 393 scan_read(mtd, buf, (loff_t)md->pages[0] << this->page_shift,
394 mtd->writesize, md); 394 mtd->writesize, md);
395 md->version[0] = buf[bbt_get_ver_offs(mtd, md)]; 395 md->version[0] = buf[bbt_get_ver_offs(mtd, md)];
396 pr_info("Bad block table at page %d, version 0x%02X\n", 396 pr_info("Bad block table at page %d, version 0x%02X\n",
@@ -405,7 +405,7 @@ static int scan_block_full(struct mtd_info *mtd, struct nand_bbt_descr *bd,
405{ 405{
406 int ret, j; 406 int ret, j;
407 407
408 ret = scan_read_raw_oob(mtd, buf, offs, readlen); 408 ret = scan_read_oob(mtd, buf, offs, readlen);
409 /* Ignore ECC errors when checking for BBM */ 409 /* Ignore ECC errors when checking for BBM */
410 if (ret && !mtd_is_bitflip_or_eccerr(ret)) 410 if (ret && !mtd_is_bitflip_or_eccerr(ret))
411 return ret; 411 return ret;
@@ -594,7 +594,7 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
594 loff_t offs = (loff_t)actblock << this->bbt_erase_shift; 594 loff_t offs = (loff_t)actblock << this->bbt_erase_shift;
595 595
596 /* Read first page */ 596 /* Read first page */
597 scan_read_raw(mtd, buf, offs, mtd->writesize, td); 597 scan_read(mtd, buf, offs, mtd->writesize, td);
598 if (!check_pattern(buf, scanlen, mtd->writesize, td)) { 598 if (!check_pattern(buf, scanlen, mtd->writesize, td)) {
599 td->pages[i] = actblock << blocktopage; 599 td->pages[i] = actblock << blocktopage;
600 if (td->options & NAND_BBT_VERSION) { 600 if (td->options & NAND_BBT_VERSION) {