[PATCH v4 05/10] mtd: denali: utilize oob_required parameter
Brian Norris
computersforpeace at gmail.com
Wed May 2 13:14:59 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 a54c186..daa368c 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1208,7 +1208,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