mtd: nand: tests: fix regression introduced in mtd_nandectest
authorJorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Tue, 1 Mar 2016 21:04:00 +0000 (16:04 -0500)
committerBrian Norris <computersforpeace@gmail.com>
Sat, 5 Mar 2016 00:59:20 +0000 (16:59 -0800)
Offending Commit: 6e94119 "mtd: nand: return consistent error codes in
ecc.correct() implementations"

The new error code was not being handled properly in double bit error
detection.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Tested-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/tests/mtd_nandecctest.c

index 79316159eec63cbca36aa06d27bfaab561b62dc0..88b6c81cebbe68123da96775b3a42c3f96da4a11 100644 (file)
@@ -187,7 +187,7 @@ static int double_bit_error_detect(void *error_data, void *error_ecc,
        __nand_calculate_ecc(error_data, size, calc_ecc);
        ret = __nand_correct_data(error_data, error_ecc, calc_ecc, size);
 
-       return (ret == -1) ? 0 : -EINVAL;
+       return (ret == -EBADMSG) ? 0 : -EINVAL;
 }
 
 static const struct nand_ecc_test nand_ecc_test[] = {