summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/vf610_nfc.c
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2015-05-08 19:07:08 +0200
committerScott Wood <scottwood@freescale.com>2015-05-24 14:26:54 -0500
commitd111bf99a81feacd3876010984a28575964ff0dc (patch)
tree1769f63d448c544ed14e147e20282a7b9186ecb1 /drivers/mtd/nand/vf610_nfc.c
parent6fcfd1e890ff752224f3266a11dec6e1b5624cb4 (diff)
mtd: vf610_nfc: allow bitflips in an empty page
Allow bit flips in a empty page up to half of the recoverable bits (strength / 2). Signed-off-by: Stefan Agner <stefan@agner.ch>
Diffstat (limited to 'drivers/mtd/nand/vf610_nfc.c')
-rw-r--r--drivers/mtd/nand/vf610_nfc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 66b335d008..16485f5713 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -527,7 +527,7 @@ static inline int vf610_nfc_correct_data(struct mtd_info *mtd, u_char *dat)
flip = count_written_bits(dat, nfc->chip.ecc.size, ecc_count);
/* ECC failed. */
- if (flip > ecc_count)
+ if (flip > ecc_count && flip > (nfc->chip.ecc.strength / 2))
return -1;
/* Erased page. */