Browse Source

nand_base: Fix NAND functions if HW ECC is used.

The 'nand read' command was previously not working, as NAND HW ECC function
pointers were being overwritten. This commit will preserve NAND function
pointers to fix 'nand read' and other nand commands with the HW ECC
configuration selected.

Signed-off-by: Anthony Felice <tony.felice@timesys.com>
Anthony Felice 11 years ago
parent
commit
f6105c2594
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/mtd/nand/nand_base.c

+ 2 - 2
drivers/mtd/nand/nand_base.c

@@ -3208,15 +3208,15 @@ int nand_scan_tail(struct mtd_info *mtd)
 		if (!chip->ecc.write_oob)
 			chip->ecc.write_oob = nand_write_oob_syndrome;
 
-#if 0
 		if (mtd->writesize >= chip->ecc.size) {
+#if 0
 			if (!chip->ecc.strength) {
 				pr_warn("Driver must set ecc.strength when using hardware ECC\n");
 				BUG();
 			}
+#endif
 			break;
 		}
-#endif
 		pr_warn("%d byte HW ECC not possible on "
 			   "%d byte page size, fallback to SW ECC\n",
 			   chip->ecc.size, mtd->writesize);