[PATCH v3 05/10] mtd: denali: utilize oob_required parameter

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


Don't return OOB if the caller doesn't require it.

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

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 436ea83..c56757f 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1204,7 +1204,9 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
 	denali_enable_dma(denali, false);
 
 	memcpy(buf, denali->buf.buf, mtd->writesize);
-	memcpy(chip->oob_poi, denali->buf.buf + mtd->writesize, mtd->oobsize);
+	if (oob_required)
+		memcpy(chip->oob_poi, denali->buf.buf + mtd->writesize,
+				mtd->oobsize);
 
 	return 0;
 }
-- 
1.7.5.4.2.g519b1




More information about the linux-mtd mailing list