aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/tests/mtd_stresstest.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/tests/mtd_stresstest.c')
-rw-r--r--drivers/mtd/tests/mtd_stresstest.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c
index 531625fc925..52ffd9120e0 100644
--- a/drivers/mtd/tests/mtd_stresstest.c
+++ b/drivers/mtd/tests/mtd_stresstest.c
@@ -30,7 +30,7 @@
30 30
31#define PRINT_PREF KERN_INFO "mtd_stresstest: " 31#define PRINT_PREF KERN_INFO "mtd_stresstest: "
32 32
33static int dev; 33static int dev = -EINVAL;
34module_param(dev, int, S_IRUGO); 34module_param(dev, int, S_IRUGO);
35MODULE_PARM_DESC(dev, "MTD device number to use"); 35MODULE_PARM_DESC(dev, "MTD device number to use");
36 36
@@ -154,7 +154,7 @@ static int do_read(void)
154 } 154 }
155 addr = eb * mtd->erasesize + offs; 155 addr = eb * mtd->erasesize + offs;
156 err = mtd->read(mtd, addr, len, &read, readbuf); 156 err = mtd->read(mtd, addr, len, &read, readbuf);
157 if (err == -EUCLEAN) 157 if (mtd_is_bitflip(err))
158 err = 0; 158 err = 0;
159 if (unlikely(err || read != len)) { 159 if (unlikely(err || read != len)) {
160 printk(PRINT_PREF "error: read failed at 0x%llx\n", 160 printk(PRINT_PREF "error: read failed at 0x%llx\n",
@@ -250,6 +250,13 @@ static int __init mtd_stresstest_init(void)
250 250
251 printk(KERN_INFO "\n"); 251 printk(KERN_INFO "\n");
252 printk(KERN_INFO "=================================================\n"); 252 printk(KERN_INFO "=================================================\n");
253
254 if (dev < 0) {
255 printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
256 printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
257 return -EINVAL;
258 }
259
253 printk(PRINT_PREF "MTD device: %d\n", dev); 260 printk(PRINT_PREF "MTD device: %d\n", dev);
254 261
255 mtd = get_mtd_device(NULL, dev); 262 mtd = get_mtd_device(NULL, dev);