mtd: rawnand: rockchip: Fix the return value in case of ECC fail

The former ECC fail return value -1 is not the correct one, change
to return 0 and let the nand base handle it. The mistake value
causing file system to be unable to detect the ECC fail status and
unable to make corresponding optimization processing.

Change-Id: Ib79d02189de383fa9815cf0524e6bcb89b3c939f
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2023-04-24 10:38:19 +08:00
parent ee909ff436
commit 00bca8ea24
2 changed files with 2 additions and 2 deletions

View File

@ -349,7 +349,7 @@ static int rk_nfc_hw_syndrome_ecc_read_page(struct mtd_info *mtd,
if (bch_st & NANDC_V6_BCH0_ST_ERR ||
bch_st & NANDC_V6_BCH1_ST_ERR) {
mtd->ecc_stats.failed++;
max_bitflips = -1;
max_bitflips = 0;
} else {
ret = NANDC_V6_ECC_ERR_CNT0(bch_st);
mtd->ecc_stats.corrected += ret;

View File

@ -339,7 +339,7 @@ static int rk_nfc_hw_syndrome_ecc_read_page(struct mtd_info *mtd,
if (bch_st & NANDC_V9_BCH0_ST_ERR ||
bch_st & NANDC_V9_BCH1_ST_ERR) {
mtd->ecc_stats.failed++;
max_bitflips = -1;
max_bitflips = 0;
} else {
ret = NANDC_V9_ECC_ERR_CNT0(bch_st);
mtd->ecc_stats.corrected += ret;