Skip to content

Commit

Permalink
mtd: mtd_nandecctest: make module_init() return an error code if test…
Browse files Browse the repository at this point in the history
… fails

Return an error code if test fails in order to detect a test case failure
by invoking tests repeatedly like this:

while sudo modprobe mtd_nandecctest; do
	sudo modprobe -r mtd_nandecctest
done

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Akinobu Mita authored and David Woodhouse committed Sep 29, 2012
1 parent 0ce0060 commit f45c299
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/mtd/tests/mtd_nandecctest.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ static int nand_ecc_test(const size_t size)

static int __init ecc_test_init(void)
{
nand_ecc_test(256);
nand_ecc_test(512);
int err;

return 0;
err = nand_ecc_test(256);
if (err)
return err;

return nand_ecc_test(512);
}

static void __exit ecc_test_exit(void)
Expand Down

0 comments on commit f45c299

Please sign in to comment.