mtd: mxc_nand: move ecc strengh setup before nand_scan_tail
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Jun 1 15:59:02 EDT 2012
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4a43faf54e9173b6acce37cf7f053fc9515a2cdf
Commit: 4a43faf54e9173b6acce37cf7f053fc9515a2cdf
Parent: 2e24e32e2759348c9290404abad4f729f791bfad
Author: Sascha Hauer <s.hauer at pengutronix.de>
AuthorDate: Fri May 25 16:22:42 2012 +0200
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Jun 1 20:23:29 2012 +0100
mtd: mxc_nand: move ecc strengh setup before nand_scan_tail
Since commit 6a918bade9dab40aaef80559bd1169c69e8d69cb, 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 at pengutronix.de>
Cc: stable at vger.kernel.org [3.4+]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
drivers/mtd/nand/mxc_nand.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index ec5ba8b..3310a48 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1465,12 +1465,6 @@ 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;
@@ -1478,6 +1472,12 @@ static int __init mxcnd_probe(struct platform_device *pdev)
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){
More information about the linux-mtd-cvs
mailing list