Patchwork [v4,04/10] mtd: cafe_nand: utilize oob_required parameter

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

Comments

Brian Norris - May 2, 2012, 5:14 p.m.
Don't write OOB if the caller doesn't require it.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/nand/cafe_nand.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 3a6c88d..aa9a0df 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -527,7 +527,8 @@  static void cafe_nand_write_page_lowlevel(struct mtd_info *mtd,
 	struct cafe_priv *cafe = mtd->priv;
 
 	chip->write_buf(mtd, buf, mtd->writesize);
-	chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
+	if (oob_required)
+		chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
 
 	/* Set up ECC autogeneration */
 	cafe->ctl2 |= (1<<30);