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>
This commit is contained in:
Stefan Agner 2018-03-03 23:26:22 +01:00 committed by Boris Brezillon
parent ac9cd36c7a
commit 148a1a5d74
1 changed files with 7 additions and 3 deletions

View File

@ -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)