Skip to content

Commit

Permalink
mtd: mxc_nand: move ecc strengh setup before nand_scan_tail
Browse files Browse the repository at this point in the history
Since commit 6a918ba, the mxc_nand driver
fails with:

Driver must set ecc.strength when using hardware ECC

This is because nand_scan_tail checks for correct ecc strength
settings, so we must set them up before nand_scan_tail.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: stable@vger.kernel.org [3.4+]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Sascha Hauer authored and David Woodhouse committed Jun 1, 2012
1 parent 2e24e32 commit 4a43faf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/mtd/nand/mxc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1465,19 +1465,19 @@ static int __init mxcnd_probe(struct platform_device *pdev)
else if (mtd->writesize == 4096)
this->ecc.layout = host->devtype_data->ecclayout_4k;

/* second phase scan */
if (nand_scan_tail(mtd)) {
err = -ENXIO;
goto escan;
}

if (this->ecc.mode == NAND_ECC_HW) {
if (nfc_is_v1())
this->ecc.strength = 1;
else
this->ecc.strength = (host->eccsize == 4) ? 4 : 8;
}

/* second phase scan */
if (nand_scan_tail(mtd)) {
err = -ENXIO;
goto escan;
}

/* Register the partitions */
mtd_device_parse_register(mtd, part_probes,
&(struct mtd_part_parser_data){
Expand Down

0 comments on commit 4a43faf

Please sign in to comment.