aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/tests
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/tests')
-rw-r--r--drivers/mtd/tests/mtd_oobtest.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c
index 5553cd4eab2..5813920e79a 100644
--- a/drivers/mtd/tests/mtd_oobtest.c
+++ b/drivers/mtd/tests/mtd_oobtest.c
@@ -343,7 +343,6 @@ static int scan_for_bad_eraseblocks(void)
343 printk(PRINT_PREF "error: cannot allocate memory\n"); 343 printk(PRINT_PREF "error: cannot allocate memory\n");
344 return -ENOMEM; 344 return -ENOMEM;
345 } 345 }
346 memset(bbt, 0 , ebcnt);
347 346
348 printk(PRINT_PREF "scanning for bad eraseblocks\n"); 347 printk(PRINT_PREF "scanning for bad eraseblocks\n");
349 for (i = 0; i < ebcnt; ++i) { 348 for (i = 0; i < ebcnt; ++i) {
@@ -392,7 +391,6 @@ static int __init mtd_oobtest_init(void)
392 mtd->writesize, ebcnt, pgcnt, mtd->oobsize); 391 mtd->writesize, ebcnt, pgcnt, mtd->oobsize);
393 392
394 err = -ENOMEM; 393 err = -ENOMEM;
395 mtd->erasesize = mtd->erasesize;
396 readbuf = kmalloc(mtd->erasesize, GFP_KERNEL); 394 readbuf = kmalloc(mtd->erasesize, GFP_KERNEL);
397 if (!readbuf) { 395 if (!readbuf) {
398 printk(PRINT_PREF "error: cannot allocate memory\n"); 396 printk(PRINT_PREF "error: cannot allocate memory\n");
@@ -476,18 +474,10 @@ static int __init mtd_oobtest_init(void)
476 use_len_max = mtd->ecclayout->oobavail; 474 use_len_max = mtd->ecclayout->oobavail;
477 vary_offset = 1; 475 vary_offset = 1;
478 simple_srand(5); 476 simple_srand(5);
479 printk(PRINT_PREF "writing OOBs of whole device\n"); 477
480 for (i = 0; i < ebcnt; ++i) { 478 err = write_whole_device();
481 if (bbt[i]) 479 if (err)
482 continue; 480 goto out;
483 err = write_eraseblock(i);
484 if (err)
485 goto out;
486 if (i % 256 == 0)
487 printk(PRINT_PREF "written up to eraseblock %u\n", i);
488 cond_resched();
489 }
490 printk(PRINT_PREF "written %u eraseblocks\n", i);
491 481
492 /* Check all eraseblocks */ 482 /* Check all eraseblocks */
493 use_offset = 0; 483 use_offset = 0;