mtd: eLBC NAND: utilize oob_required parameter
authorBrian Norris <computersforpeace@gmail.com>
Wed, 2 May 2012 17:15:00 +0000 (10:15 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 14 May 2012 04:21:39 +0000 (23:21 -0500)
Don't read OOB if the caller doesn't require it.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/fsl_elbc_nand.c

index 11e34010272fad73d8cf814e78fe9a28f707187d..784293806110acc63ee4ae062c689dab534860d6 100644 (file)
@@ -754,7 +754,8 @@ static int fsl_elbc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
        struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = ctrl->nand;
 
        fsl_elbc_read_buf(mtd, buf, mtd->writesize);
-       fsl_elbc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
+       if (oob_required)
+               fsl_elbc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
 
        if (fsl_elbc_wait(mtd, chip) & NAND_STATUS_FAIL)
                mtd->ecc_stats.failed++;