From: Jorge Ramirez-Ortiz Date: Tue, 1 Mar 2016 21:04:00 +0000 (-0500) Subject: mtd: nand: tests: fix regression introduced in mtd_nandectest X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c57753d4541d5104284abbdceb841e690394e55f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mtd: nand: tests: fix regression introduced in mtd_nandectest 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 Reviewed-by: Boris Brezillon Tested-by: Franklin S Cooper Jr Signed-off-by: Brian Norris --- diff --git a/drivers/mtd/tests/mtd_nandecctest.c b/drivers/mtd/tests/mtd_nandecctest.c index 79316159eec6..88b6c81cebbe 100644 --- a/drivers/mtd/tests/mtd_nandecctest.c +++ b/drivers/mtd/tests/mtd_nandecctest.c @@ -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[] = {