[PATCH v3 03/10] mtd: Blackfin NFC: utilize oob_required parameter

Brian Norris computersforpeace at gmail.com
Fri Apr 27 21:29:47 EDT 2012


Don't read/write OOB if the caller doesn't require it.

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

diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index 3f1c185..8188416 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -561,7 +561,8 @@ static int bf5xx_nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip
 		uint8_t *buf, int oob_required, int page)
 {
 	bf5xx_nand_read_buf(mtd, buf, mtd->writesize);
-	bf5xx_nand_read_buf(mtd, chip->oob_poi, mtd->oobsize);
+	if (oob_required)
+		bf5xx_nand_read_buf(mtd, chip->oob_poi, mtd->oobsize);
 
 	return 0;
 }
@@ -570,7 +571,8 @@ static void bf5xx_nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *ch
 		const uint8_t *buf, int oob_required)
 {
 	bf5xx_nand_write_buf(mtd, buf, mtd->writesize);
-	bf5xx_nand_write_buf(mtd, chip->oob_poi, mtd->oobsize);
+	if (oob_required)
+		bf5xx_nand_write_buf(mtd, chip->oob_poi, mtd->oobsize);
 }
 
 /*
-- 
1.7.5.4.2.g519b1




More information about the linux-mtd mailing list