Skip to content

Commit 48bf35d

Browse files
Boris BREZILLONcomputersforpeace
authored andcommitted
mtd: nand: jz4740: remove custom 'erased check' implementation
The jz4740 driver is manually checking for 'erased pages' while correcting ECC bytes. This logic can now done by the core infrastructure, and can thus be removed from this driver. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
1 parent cc01e60 commit 48bf35d

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

drivers/mtd/nand/jz4740_nand.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -224,24 +224,6 @@ static int jz_nand_correct_ecc_rs(struct mtd_info *mtd, uint8_t *dat,
224224
uint32_t t;
225225
unsigned int timeout = 1000;
226226

227-
t = read_ecc[0];
228-
229-
if (t == 0xff) {
230-
for (i = 1; i < 9; ++i)
231-
t &= read_ecc[i];
232-
233-
t &= dat[0];
234-
t &= dat[nand->chip.ecc.size / 2];
235-
t &= dat[nand->chip.ecc.size - 1];
236-
237-
if (t == 0xff) {
238-
for (i = 1; i < nand->chip.ecc.size - 1; ++i)
239-
t &= dat[i];
240-
if (t == 0xff)
241-
return 0;
242-
}
243-
}
244-
245227
for (i = 0; i < 9; ++i)
246228
writeb(read_ecc[i], nand->base + JZ_REG_NAND_PAR0 + i);
247229

@@ -443,6 +425,7 @@ static int jz_nand_probe(struct platform_device *pdev)
443425
chip->ecc.size = 512;
444426
chip->ecc.bytes = 9;
445427
chip->ecc.strength = 4;
428+
chip->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK;
446429

447430
if (pdata)
448431
chip->ecc.layout = pdata->ecc_layout;

0 commit comments

Comments
 (0)