summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/nand_util.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2014-12-26 22:20:58 +0900
committerStefan Agner <stefan@agner.ch>2015-04-01 09:01:38 +0200
commit0b7515a9233989326ef2e86e6d19531d9291efff (patch)
tree0466720ba90d462303e66326307866496fda7eb1 /drivers/mtd/nand/nand_util.c
parenteed5255d6cca9afc6f90d770c40256ff3a0ee117 (diff)
mtd: nand: do not scan BBT after scrub2014.10-toradex-next
Currently, "nand scrub" runs chip->scan_bbt at the end of nand_erase_opts() even if NAND_SKIP_BBTSCAN flag is set. It violates the intention of NAND_SKIP_BBTSCAN. Move NAND_SKIP_BBTSCAN flag check to nand_block_checkbad() so that chip->scan_bbt() is never run if NAND_SKIP_BBTSCAN is set. Also, unset NAND_BBT_SCANNED flag instead of running chip->scan_bbt() right after scrub. We can be lazier here because the BBT is scanned at the next call of nand_block_checkbad(). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'drivers/mtd/nand/nand_util.c')
-rw-r--r--drivers/mtd/nand/nand_util.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 024f6fb440..afdd160d81 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -91,6 +91,7 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
kfree(chip->bbt);
}
chip->bbt = NULL;
+ chip->options &= ~NAND_BBT_SCANNED;
}
for (erased_length = 0;
@@ -179,9 +180,6 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts)
if (!opts->quiet)
printf("\n");
- if (opts->scrub)
- chip->scan_bbt(meminfo);
-
return 0;
}