diff options
author | Morten Thunberg Svendsen <mts.doredevelopment@gmail.com> | 2010-01-06 10:48:18 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-01-13 09:06:17 +0000 |
commit | f5e2bae0aad03164ffc7ce9dfeee6608e2c87dba (patch) | |
tree | 6993fa233c58a12ffe4f8136a28309c2d9cc762e /drivers/mtd/tests/mtd_stresstest.c | |
parent | f6a8c60960bbea378142d1fa1b3d111555ee41c7 (diff) |
mtd: tests: fix read, speed and stress tests on NOR flash
Before using block_isbad() check if mtd->block_isbad() is defined.
Calculating pgcnt must be done using pgsize defined to 512 on
NOR and mtd->writesize for NAND, not using mtd->writesize directly.
Signed-off-by: Morten Thunberg Svendsen <mts.doredevelopment@gmail.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/tests/mtd_stresstest.c')
-rw-r--r-- | drivers/mtd/tests/mtd_stresstest.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c index 63920476b57..a99d3cd737d 100644 --- a/drivers/mtd/tests/mtd_stresstest.c +++ b/drivers/mtd/tests/mtd_stresstest.c @@ -227,6 +227,10 @@ static int scan_for_bad_eraseblocks(void) } memset(bbt, 0 , ebcnt); + /* NOR flash does not implement block_isbad */ + if (mtd->block_isbad == NULL) + return 0; + printk(PRINT_PREF "scanning for bad eraseblocks\n"); for (i = 0; i < ebcnt; ++i) { bbt[i] = is_block_bad(i) ? 1 : 0; @@ -265,7 +269,7 @@ static int __init mtd_stresstest_init(void) tmp = mtd->size; do_div(tmp, mtd->erasesize); ebcnt = tmp; - pgcnt = mtd->erasesize / mtd->writesize; + pgcnt = mtd->erasesize / pgsize; printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, " "page size %u, count of eraseblocks %u, pages per " |