aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/tests/mtd_torturetest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/tests/mtd_torturetest.c')
-rw-r--r--drivers/mtd/tests/mtd_torturetest.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mtd/tests/mtd_torturetest.c b/drivers/mtd/tests/mtd_torturetest.c
index 25786ce97c8e..03ab649a6964 100644
--- a/drivers/mtd/tests/mtd_torturetest.c
+++ b/drivers/mtd/tests/mtd_torturetest.c
@@ -46,7 +46,7 @@ static int pgcnt;
46module_param(pgcnt, int, S_IRUGO); 46module_param(pgcnt, int, S_IRUGO);
47MODULE_PARM_DESC(pgcnt, "number of pages per eraseblock to torture (0 => all)"); 47MODULE_PARM_DESC(pgcnt, "number of pages per eraseblock to torture (0 => all)");
48 48
49static int dev; 49static int dev = -EINVAL;
50module_param(dev, int, S_IRUGO); 50module_param(dev, int, S_IRUGO);
51MODULE_PARM_DESC(dev, "MTD device number to use"); 51MODULE_PARM_DESC(dev, "MTD device number to use");
52 52
@@ -213,6 +213,13 @@ static int __init tort_init(void)
213 printk(KERN_INFO "=================================================\n"); 213 printk(KERN_INFO "=================================================\n");
214 printk(PRINT_PREF "Warning: this program is trying to wear out your " 214 printk(PRINT_PREF "Warning: this program is trying to wear out your "
215 "flash, stop it if this is not wanted.\n"); 215 "flash, stop it if this is not wanted.\n");
216
217 if (dev < 0) {
218 printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
219 printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
220 return -EINVAL;
221 }
222
216 printk(PRINT_PREF "MTD device: %d\n", dev); 223 printk(PRINT_PREF "MTD device: %d\n", dev);
217 printk(PRINT_PREF "torture %d eraseblocks (%d-%d) of mtd%d\n", 224 printk(PRINT_PREF "torture %d eraseblocks (%d-%d) of mtd%d\n",
218 ebcnt, eb, eb + ebcnt - 1, dev); 225 ebcnt, eb, eb + ebcnt - 1, dev);