diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-08-26 08:06:44 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 10:13:08 -0400 |
commit | f45c2990dc3de65d22e5f3b2f6b5df60a102e493 (patch) | |
tree | a2120a18fecda33ac17d67b8aea6d64d48180ae6 /drivers | |
parent | 0ce0060f103db02edcaa000bbd31cdebcfaa115c (diff) |
mtd: mtd_nandecctest: make module_init() return an error code if test 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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/tests/mtd_nandecctest.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/tests/mtd_nandecctest.c b/drivers/mtd/tests/mtd_nandecctest.c index 4d7b171e825f..f71ed92b932c 100644 --- a/drivers/mtd/tests/mtd_nandecctest.c +++ b/drivers/mtd/tests/mtd_nandecctest.c | |||
@@ -66,10 +66,13 @@ static int nand_ecc_test(const size_t size) | |||
66 | 66 | ||
67 | static int __init ecc_test_init(void) | 67 | static int __init ecc_test_init(void) |
68 | { | 68 | { |
69 | nand_ecc_test(256); | 69 | int err; |
70 | nand_ecc_test(512); | ||
71 | 70 | ||
72 | return 0; | 71 | err = nand_ecc_test(256); |
72 | if (err) | ||
73 | return err; | ||
74 | |||
75 | return nand_ecc_test(512); | ||
73 | } | 76 | } |
74 | 77 | ||
75 | static void __exit ecc_test_exit(void) | 78 | static void __exit ecc_test_exit(void) |