]> git.sur5r.net Git - u-boot/blobdiff - drivers/mtd/nand/nand_base.c
mtd/nand:Fix wrong usage of is_blank() in fsl_ifc_run_command
[u-boot] / drivers / mtd / nand / nand_base.c
index 8ab83036f5922605ae4ef8d1f0da14bb9dbb12c8..44f7b914578d1effda938c808d8696417a6812dc 100644 (file)
@@ -479,6 +479,11 @@ 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->options |= NAND_BBT_SCANNED;
+               chip->scan_bbt(mtd);
+       }
+
        if (!chip->bbt)
                return chip->block_bad(mtd, ofs, getchip);
 
@@ -3166,10 +3171,9 @@ int nand_scan_tail(struct mtd_info *mtd)
 
        /* Check, if we should skip the bad block table scan */
        if (chip->options & NAND_SKIP_BBTSCAN)
-               return 0;
+               chip->options |= NAND_BBT_SCANNED;
 
-       /* Build bad block table */
-       return chip->scan_bbt(mtd);
+       return 0;
 }
 
 /**