Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Boris BREZILLON and committed by
Brian Norris
48bf35de cc01e607

+1 -18
+1 -18
drivers/mtd/nand/jz4740_nand.c
··· 224 224 uint32_t t; 225 225 unsigned int timeout = 1000; 226 226 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 - 245 227 for (i = 0; i < 9; ++i) 246 228 writeb(read_ecc[i], nand->base + JZ_REG_NAND_PAR0 + i); 247 229 ··· 425 443 chip->ecc.size = 512; 426 444 chip->ecc.bytes = 9; 427 445 chip->ecc.strength = 4; 446 + chip->ecc.options = NAND_ECC_GENERIC_ERASED_CHECK; 428 447 429 448 if (pdata) 430 449 chip->ecc.layout = pdata->ecc_layout;