summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2008-12-16 14:24:16 -0600
committerScott Wood <scottwood@freescale.com>2008-12-16 14:40:34 -0600
commitff49ea8977b56916edd5b1766d9939010e30b181 (patch)
tree98a82242c8fc9b2d2b26ace7cce6f25984f48082 /drivers/mtd/nand
parent7f202217356f19e519e6ec57a29de9af73067037 (diff)
downloadu-boot-imx-ff49ea8977b56916edd5b1766d9939010e30b181.zip
u-boot-imx-ff49ea8977b56916edd5b1766d9939010e30b181.tar.gz
u-boot-imx-ff49ea8977b56916edd5b1766d9939010e30b181.tar.bz2
NAND: Mark the BBT as scanned prior to calling scan_bbt.
Otherwise, recursion can occur if scan_bbt does not find a bad block table, and tries to write one, and the attempt to erase the BBT area causes a bad block check. Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/nand_base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ba05b76..94a65d4 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -460,8 +460,8 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int getchip,
struct nand_chip *chip = mtd->priv;
if (!(chip->options & NAND_BBT_SCANNED)) {
- chip->scan_bbt(mtd);
chip->options |= NAND_BBT_SCANNED;
+ chip->scan_bbt(mtd);
}
if (!chip->bbt)