mtd: nand: utilize oob_required parameter
Don't read/write OOB if the caller doesn't require it. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
7725cc8593
commit
279f08d4ef
|
@ -1075,6 +1075,7 @@ 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);
|
||||
if (oob_required)
|
||||
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1928,6 +1929,7 @@ 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);
|
||||
if (oob_required)
|
||||
chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue