mtd: nand: utilize oob_required parameter
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon May 28 07:59:10 EDT 2012
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=279f08d4ef6548be4e2fa638245adebc77436e54
Commit: 279f08d4ef6548be4e2fa638245adebc77436e54
Parent: 7725cc85932bd02dd12c23108e0ef748c551ccba
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Wed May 2 10:15:03 2012 -0700
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sun May 13 23:21:57 2012 -0500
mtd: nand: utilize oob_required parameter
Don't read/write OOB if the caller doesn't require it.
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
drivers/mtd/nand/nand_base.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 464b742..14e9b32 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1075,7 +1075,8 @@ static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page)
{
chip->read_buf(mtd, buf, mtd->writesize);
- chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
+ if (oob_required)
+ chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
return 0;
}
@@ -1928,7 +1929,8 @@ static void nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
const uint8_t *buf, int oob_required)
{
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);
}
/**
More information about the linux-mtd-cvs
mailing list