]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/mtd/nand/fsl_ifc_nand.c
Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-opp'
[linux.git] / drivers / mtd / nand / fsl_ifc_nand.c
index 0a177b1bfe3e77600b9fc9c943f6f961d195cd4f..d1570f512f0bbad5c07c9903528c125e412c029a 100644 (file)
@@ -258,9 +258,15 @@ static void fsl_ifc_run_command(struct mtd_info *mtd)
                int bufnum = nctrl->page & priv->bufnum_mask;
                int sector = bufnum * chip->ecc.steps;
                int sector_end = sector + chip->ecc.steps - 1;
+               __be32 *eccstat_regs;
+
+               if (ctrl->version >= FSL_IFC_VERSION_2_0_0)
+                       eccstat_regs = ifc->ifc_nand.v2_nand_eccstat;
+               else
+                       eccstat_regs = ifc->ifc_nand.v1_nand_eccstat;
 
                for (i = sector / 4; i <= sector_end / 4; i++)
-                       eccstat[i] = ifc_in32(&ifc->ifc_nand.nand_eccstat[i]);
+                       eccstat[i] = ifc_in32(&eccstat_regs[i]);
 
                for (i = sector; i <= sector_end; i++) {
                        errors = check_read_ecc(mtd, ctrl, eccstat, i);