diff options
Diffstat (limited to 'drivers/mtd/tests/mtd_speedtest.c')
-rw-r--r-- | drivers/mtd/tests/mtd_speedtest.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/mtd/tests/mtd_speedtest.c b/drivers/mtd/tests/mtd_speedtest.c index 161feeb7b8b9..9bd986ef3b53 100644 --- a/drivers/mtd/tests/mtd_speedtest.c +++ b/drivers/mtd/tests/mtd_speedtest.c | |||
@@ -16,7 +16,7 @@ | |||
16 | * | 16 | * |
17 | * Test read and write speed of a MTD device. | 17 | * Test read and write speed of a MTD device. |
18 | * | 18 | * |
19 | * Author: Adrian Hunter <ext-adrian.hunter@nokia.com> | 19 | * Author: Adrian Hunter <adrian.hunter@nokia.com> |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
@@ -33,6 +33,11 @@ static int dev; | |||
33 | module_param(dev, int, S_IRUGO); | 33 | module_param(dev, int, S_IRUGO); |
34 | MODULE_PARM_DESC(dev, "MTD device number to use"); | 34 | MODULE_PARM_DESC(dev, "MTD device number to use"); |
35 | 35 | ||
36 | static int count; | ||
37 | module_param(count, int, S_IRUGO); | ||
38 | MODULE_PARM_DESC(count, "Maximum number of eraseblocks to use " | ||
39 | "(0 means use all)"); | ||
40 | |||
36 | static struct mtd_info *mtd; | 41 | static struct mtd_info *mtd; |
37 | static unsigned char *iobuf; | 42 | static unsigned char *iobuf; |
38 | static unsigned char *bbt; | 43 | static unsigned char *bbt; |
@@ -326,7 +331,10 @@ static int __init mtd_speedtest_init(void) | |||
326 | 331 | ||
327 | printk(KERN_INFO "\n"); | 332 | printk(KERN_INFO "\n"); |
328 | printk(KERN_INFO "=================================================\n"); | 333 | printk(KERN_INFO "=================================================\n"); |
329 | printk(PRINT_PREF "MTD device: %d\n", dev); | 334 | if (count) |
335 | printk(PRINT_PREF "MTD device: %d count: %d\n", dev, count); | ||
336 | else | ||
337 | printk(PRINT_PREF "MTD device: %d\n", dev); | ||
330 | 338 | ||
331 | mtd = get_mtd_device(NULL, dev); | 339 | mtd = get_mtd_device(NULL, dev); |
332 | if (IS_ERR(mtd)) { | 340 | if (IS_ERR(mtd)) { |
@@ -353,6 +361,9 @@ static int __init mtd_speedtest_init(void) | |||
353 | (unsigned long long)mtd->size, mtd->erasesize, | 361 | (unsigned long long)mtd->size, mtd->erasesize, |
354 | pgsize, ebcnt, pgcnt, mtd->oobsize); | 362 | pgsize, ebcnt, pgcnt, mtd->oobsize); |
355 | 363 | ||
364 | if (count > 0 && count < ebcnt) | ||
365 | ebcnt = count; | ||
366 | |||
356 | err = -ENOMEM; | 367 | err = -ENOMEM; |
357 | iobuf = kmalloc(mtd->erasesize, GFP_KERNEL); | 368 | iobuf = kmalloc(mtd->erasesize, GFP_KERNEL); |
358 | if (!iobuf) { | 369 | if (!iobuf) { |