summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/sh_flctl.c
diff options
context:
space:
mode:
authorBastian Hecht <hechtb@googlemail.com>2012-07-05 12:41:02 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-09-29 14:49:38 +0100
commit894824f9731a805b70b553220ae58e5475ff6ff1 (patch)
tree58d80a54f596fe5ff2959ea1ad76d7536ce57c4c /drivers/mtd/nand/sh_flctl.c
parentd76236f30f1280f9345bb266a161e3ba60518c83 (diff)
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>
Diffstat (limited to 'drivers/mtd/nand/sh_flctl.c')
-rw-r--r--drivers/mtd/nand/sh_flctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
index 1343315b37ba..4ff8ef526c02 100644
--- a/drivers/mtd/nand/sh_flctl.c
+++ b/drivers/mtd/nand/sh_flctl.c
@@ -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;
}