From patchwork Thu Jun 7 18:32:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: mtd: nand: ignore ecc errors during bbt reads Date: Thu, 07 Jun 2012 08:32:08 -0000 From: Mike Dunn X-Patchwork-Id: 163657 Message-Id: <1339093928-17545-1-git-send-email-mikedunn@newsguy.com> To: linux-mtd@lists.infradead.org Cc: Mike Dunn Ignore ecc errors in the scan_read_raw_oob() function. Also removed code that is now redundant. Signed-off-by: Mike Dunn --- drivers/mtd/nand/nand_bbt.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 30d1319..585da44 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -319,7 +319,8 @@ static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs, res = mtd_read_oob(mtd, offs, &ops); - if (res) + /* Ignore ECC errors when checking for BBM */ + if (res && !mtd_is_bitflip_or_eccerr(res)) return res; buf += mtd->oobsize + mtd->writesize; @@ -406,8 +407,7 @@ static int scan_block_full(struct mtd_info *mtd, struct nand_bbt_descr *bd, int ret, j; ret = scan_read_raw_oob(mtd, buf, offs, readlen); - /* Ignore ECC errors when checking for BBM */ - if (ret && !mtd_is_bitflip_or_eccerr(ret)) + if (ret) return ret; for (j = 0; j < len; j++, buf += scanlen) {