diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/mtd/tests/mtd_stresstest.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/mtd/tests/mtd_stresstest.c')
-rw-r--r-- | drivers/mtd/tests/mtd_stresstest.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c index 63920476b57a..3854afec56d0 100644 --- a/drivers/mtd/tests/mtd_stresstest.c +++ b/drivers/mtd/tests/mtd_stresstest.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/moduleparam.h> | 24 | #include <linux/moduleparam.h> |
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/mtd/mtd.h> | 26 | #include <linux/mtd/mtd.h> |
27 | #include <linux/slab.h> | ||
27 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
28 | #include <linux/vmalloc.h> | 29 | #include <linux/vmalloc.h> |
29 | 30 | ||
@@ -227,6 +228,10 @@ static int scan_for_bad_eraseblocks(void) | |||
227 | } | 228 | } |
228 | memset(bbt, 0 , ebcnt); | 229 | memset(bbt, 0 , ebcnt); |
229 | 230 | ||
231 | /* NOR flash does not implement block_isbad */ | ||
232 | if (mtd->block_isbad == NULL) | ||
233 | return 0; | ||
234 | |||
230 | printk(PRINT_PREF "scanning for bad eraseblocks\n"); | 235 | printk(PRINT_PREF "scanning for bad eraseblocks\n"); |
231 | for (i = 0; i < ebcnt; ++i) { | 236 | for (i = 0; i < ebcnt; ++i) { |
232 | bbt[i] = is_block_bad(i) ? 1 : 0; | 237 | bbt[i] = is_block_bad(i) ? 1 : 0; |
@@ -265,7 +270,7 @@ static int __init mtd_stresstest_init(void) | |||
265 | tmp = mtd->size; | 270 | tmp = mtd->size; |
266 | do_div(tmp, mtd->erasesize); | 271 | do_div(tmp, mtd->erasesize); |
267 | ebcnt = tmp; | 272 | ebcnt = tmp; |
268 | pgcnt = mtd->erasesize / mtd->writesize; | 273 | pgcnt = mtd->erasesize / pgsize; |
269 | 274 | ||
270 | printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, " | 275 | printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, " |
271 | "page size %u, count of eraseblocks %u, pages per " | 276 | "page size %u, count of eraseblocks %u, pages per " |