Skip to content

Commit

Permalink
[MTD] OneNAND: return ecc error code only when 2-bit ecc occurs
Browse files Browse the repository at this point in the history
we don't need to return ecc error when 1-bit ecc.
We only return error code when 2-bit ecc error

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
  • Loading branch information
Kyungmin Park authored and Artem Bityutskiy committed Jan 10, 2007
1 parent a8de85d commit b3c9f8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ static int onenand_wait(struct mtd_info *mtd, int state)
int ecc = this->read_word(this->base + ONENAND_REG_ECC_STATUS);
if (ecc) {
DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: ECC error = 0x%04x\n", ecc);
if (ecc & ONENAND_ECC_2BIT_ALL)
if (ecc & ONENAND_ECC_2BIT_ALL) {
mtd->ecc_stats.failed++;
else if (ecc & ONENAND_ECC_1BIT_ALL)
return ecc;
} else if (ecc & ONENAND_ECC_1BIT_ALL)
mtd->ecc_stats.corrected++;
}
return ecc;
}

return 0;
Expand Down

0 comments on commit b3c9f8b

Please sign in to comment.