summaryrefslogtreecommitdiff
path: root/drivers/mtd/tests
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2018-03-04 01:26:22 +0300
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-03-21 11:50:57 +0300
commit148a1a5d74485c5595481c3a2bd78daf50cd346a (patch)
tree949509916885d374b4df86599d32ee1655a22315 /drivers/mtd/tests
parentac9cd36c7a5dc79b3d10f0110bc096918109fdf8 (diff)
downloadlinux-148a1a5d74485c5595481c3a2bd78daf50cd346a.tar.xz
mtd: tests: check erase block count in page test
When there is only a single erase block, the cross erase test does not report sensible errors. Warn in case there is only a single erase block instead of executing the test. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'drivers/mtd/tests')
-rw-r--r--drivers/mtd/tests/pagetest.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mtd/tests/pagetest.c b/drivers/mtd/tests/pagetest.c
index ff1e0565b020..bc303cac9f43 100644
--- a/drivers/mtd/tests/pagetest.c
+++ b/drivers/mtd/tests/pagetest.c
@@ -435,9 +435,13 @@ static int __init mtd_pagetest_init(void)
if (err)
goto out;
- err = erasecrosstest();
- if (err)
- goto out;
+ if (ebcnt > 1) {
+ err = erasecrosstest();
+ if (err)
+ goto out;
+ } else {
+ pr_info("skipping erasecrosstest, 2 erase blocks needed\n");
+ }
err = erasetest();
if (err)