diff options
author | Stefan Agner <stefan@agner.ch> | 2018-03-03 23:26:22 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-03-21 09:50:57 +0100 |
commit | 148a1a5d74485c5595481c3a2bd78daf50cd346a (patch) | |
tree | 949509916885d374b4df86599d32ee1655a22315 /drivers/mtd/tests | |
parent | mtd: nftl: use %*ph to print small buffer (diff) | |
download | linux-148a1a5d74485c5595481c3a2bd78daf50cd346a.tar.xz linux-148a1a5d74485c5595481c3a2bd78daf50cd346a.zip |
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.c | 10 |
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) |