diff options
Diffstat (limited to 'drivers/mtd/tests/mtd_torturetest.c')
-rw-r--r-- | drivers/mtd/tests/mtd_torturetest.c | 9 |
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; | |||
46 | module_param(pgcnt, int, S_IRUGO); | 46 | module_param(pgcnt, int, S_IRUGO); |
47 | MODULE_PARM_DESC(pgcnt, "number of pages per eraseblock to torture (0 => all)"); | 47 | MODULE_PARM_DESC(pgcnt, "number of pages per eraseblock to torture (0 => all)"); |
48 | 48 | ||
49 | static int dev; | 49 | static int dev = -EINVAL; |
50 | module_param(dev, int, S_IRUGO); | 50 | module_param(dev, int, S_IRUGO); |
51 | MODULE_PARM_DESC(dev, "MTD device number to use"); | 51 | MODULE_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); |