From: Bastian Hecht Date: Thu, 5 Jul 2012 10:41:02 +0000 (+0200) Subject: mtd: sh_flctl: Only copy OOB data if it is required X-Git-Tag: firefly_0821_release~3680^2~1874^2~111 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=894824f9731a805b70b553220ae58e5475ff6ff1;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- 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; }