mtd: sh_flctl: Only copy OOB data if it is required

Check the new oob_required flag and only copy the OOB data to the internal
buffer if needed.

Signed-off-by: Bastian Hecht <hechtb@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:
Bastian Hecht 2012-07-05 12:41:02 +02:00 committed by David Woodhouse
parent d76236f30f
commit 894824f973
1 changed files with 2 additions and 1 deletions

View File

@ -396,7 +396,8 @@ static int flctl_read_page_hwecc(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;
}