diff options
Diffstat (limited to 'drivers/mtd/nand/nand_bbt.c')
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 443fa82cde6a..9bb8453d224e 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c | |||
@@ -201,12 +201,12 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, | |||
201 | res = mtd_read(mtd, from, len, &retlen, buf); | 201 | res = mtd_read(mtd, from, len, &retlen, buf); |
202 | if (res < 0) { | 202 | if (res < 0) { |
203 | if (mtd_is_eccerr(res)) { | 203 | if (mtd_is_eccerr(res)) { |
204 | pr_info("nand_bbt: ECC error in BBT at " | 204 | pr_info("nand_bbt: ECC error in BBT at 0x%012llx\n", |
205 | "0x%012llx\n", from & ~mtd->writesize); | 205 | from & ~mtd->writesize); |
206 | return res; | 206 | return res; |
207 | } else if (mtd_is_bitflip(res)) { | 207 | } else if (mtd_is_bitflip(res)) { |
208 | pr_info("nand_bbt: corrected error in BBT at " | 208 | pr_info("nand_bbt: corrected error in BBT at 0x%012llx\n", |
209 | "0x%012llx\n", from & ~mtd->writesize); | 209 | from & ~mtd->writesize); |
210 | ret = res; | 210 | ret = res; |
211 | } else { | 211 | } else { |
212 | pr_info("nand_bbt: error reading BBT\n"); | 212 | pr_info("nand_bbt: error reading BBT\n"); |
@@ -580,8 +580,8 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr | |||
580 | if (td->pages[i] == -1) | 580 | if (td->pages[i] == -1) |
581 | pr_warn("Bad block table not found for chip %d\n", i); | 581 | pr_warn("Bad block table not found for chip %d\n", i); |
582 | else | 582 | else |
583 | pr_info("Bad block table found at page %d, version " | 583 | pr_info("Bad block table found at page %d, version 0x%02X\n", |
584 | "0x%02X\n", td->pages[i], td->version[i]); | 584 | td->pages[i], td->version[i]); |
585 | } | 585 | } |
586 | return 0; | 586 | return 0; |
587 | } | 587 | } |
@@ -725,12 +725,10 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, | |||
725 | res = mtd_read(mtd, to, len, &retlen, buf); | 725 | res = mtd_read(mtd, to, len, &retlen, buf); |
726 | if (res < 0) { | 726 | if (res < 0) { |
727 | if (retlen != len) { | 727 | if (retlen != len) { |
728 | pr_info("nand_bbt: error reading block " | 728 | pr_info("nand_bbt: error reading block for writing the bad block table\n"); |
729 | "for writing the bad block table\n"); | ||
730 | return res; | 729 | return res; |
731 | } | 730 | } |
732 | pr_warn("nand_bbt: ECC error while reading " | 731 | pr_warn("nand_bbt: ECC error while reading block for writing bad block table\n"); |
733 | "block for writing bad block table\n"); | ||
734 | } | 732 | } |
735 | /* Read oob data */ | 733 | /* Read oob data */ |
736 | ops.ooblen = (len >> this->page_shift) * mtd->oobsize; | 734 | ops.ooblen = (len >> this->page_shift) * mtd->oobsize; |
@@ -1338,9 +1336,8 @@ int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt) | |||
1338 | block = (int)(offs >> this->bbt_erase_shift); | 1336 | block = (int)(offs >> this->bbt_erase_shift); |
1339 | res = bbt_get_entry(this, block); | 1337 | res = bbt_get_entry(this, block); |
1340 | 1338 | ||
1341 | pr_debug("nand_isbad_bbt(): bbt info for offs 0x%08x: " | 1339 | pr_debug("nand_isbad_bbt(): bbt info for offs 0x%08x: (block %d) 0x%02x\n", |
1342 | "(block %d) 0x%02x\n", | 1340 | (unsigned int)offs, block, res); |
1343 | (unsigned int)offs, block, res); | ||
1344 | 1341 | ||
1345 | switch (res) { | 1342 | switch (res) { |
1346 | case BBT_BLOCK_GOOD: | 1343 | case BBT_BLOCK_GOOD: |