diff options
Diffstat (limited to 'drivers/mtd/tests/mtd_subpagetest.c')
-rw-r--r-- | drivers/mtd/tests/mtd_subpagetest.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c index 2b51842d08fa..1a05bfac4eee 100644 --- a/drivers/mtd/tests/mtd_subpagetest.c +++ b/drivers/mtd/tests/mtd_subpagetest.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #define PRINT_PREF KERN_INFO "mtd_subpagetest: " | 30 | #define PRINT_PREF KERN_INFO "mtd_subpagetest: " |
31 | 31 | ||
32 | static int dev; | 32 | static int dev = -EINVAL; |
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 | ||
@@ -379,6 +379,13 @@ static int __init mtd_subpagetest_init(void) | |||
379 | 379 | ||
380 | printk(KERN_INFO "\n"); | 380 | printk(KERN_INFO "\n"); |
381 | printk(KERN_INFO "=================================================\n"); | 381 | printk(KERN_INFO "=================================================\n"); |
382 | |||
383 | if (dev < 0) { | ||
384 | printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n"); | ||
385 | printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n"); | ||
386 | return -EINVAL; | ||
387 | } | ||
388 | |||
382 | printk(PRINT_PREF "MTD device: %d\n", dev); | 389 | printk(PRINT_PREF "MTD device: %d\n", dev); |
383 | 390 | ||
384 | mtd = get_mtd_device(NULL, dev); | 391 | mtd = get_mtd_device(NULL, dev); |