Skip to content

Commit bc29c95

Browse files
Boris BREZILLONcomputersforpeace
authored andcommitted
mtd: nand: davinci: remove custom 'erased check' implementation
The davinci 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> Tested-by: Franklin S Cooper Jr. <fcooper@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
1 parent 40cbe6e commit bc29c95

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/mtd/nand/davinci_nand.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,6 @@ static int nand_davinci_correct_4bit(struct mtd_info *mtd,
317317
unsigned num_errors, corrected;
318318
unsigned long timeo;
319319

320-
/* All bytes 0xff? It's an erased page; ignore its ECC. */
321-
for (i = 0; i < 10; i++) {
322-
if (ecc_code[i] != 0xff)
323-
goto compare;
324-
}
325-
return 0;
326-
327-
compare:
328320
/* Unpack ten bytes into eight 10 bit values. We know we're
329321
* little-endian, and use type punning for less shifting/masking.
330322
*/
@@ -749,6 +741,7 @@ static int nand_davinci_probe(struct platform_device *pdev)
749741
info->chip.ecc.correct = nand_davinci_correct_4bit;
750742
info->chip.ecc.hwctl = nand_davinci_hwctl_4bit;
751743
info->chip.ecc.bytes = 10;
744+
info->chip.ecc.options = NAND_ECC_GENERIC_ERASED_CHECK;
752745
} else {
753746
info->chip.ecc.calculate = nand_davinci_calculate_1bit;
754747
info->chip.ecc.correct = nand_davinci_correct_1bit;

0 commit comments

Comments
 (0)