Patchwork [v4,07/10] mtd: IFC NAND: utilize oob_required parameter

login
register
mail settings
Submitter Brian Norris
Date May 2, 2012, 5:15 p.m.
Message ID <1335978904-8005-8-git-send-email-computersforpeace@gmail.com>
Download mbox | patch
Permalink /patch/156508/
State Accepted
Commit a6976cdfe69756436ed8c22b7a03e47a7efe36fb
Headers show

Comments

Brian Norris - May 2, 2012, 5:15 p.m.
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>
---
 drivers/mtd/nand/fsl_ifc_nand.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index c085df3..9602c1b 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -706,7 +706,8 @@  static int fsl_ifc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
 	struct fsl_ifc_nand_ctrl *nctrl = ifc_nand_ctrl;
 
 	fsl_ifc_read_buf(mtd, buf, mtd->writesize);
-	fsl_ifc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
+	if (oob_required)
+		fsl_ifc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
 
 	if (ctrl->nand_stat & IFC_NAND_EVTER_STAT_ECCER)
 		dev_err(priv->dev, "NAND Flash ECC Uncorrectable Error\n");