From 1120275b7e44454035142e4c8dde600cad6913af Mon Sep 17 00:00:00 2001 From: Bastian Hecht Date: Thu, 5 Jul 2012 12:41:02 +0200 Subject: [PATCH] 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 --- drivers/mtd/nand/sh_flctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c index e4f31ef0a11f..0b798fbf902c 100644 --- a/drivers/mtd/nand/sh_flctl.c +++ b/drivers/mtd/nand/sh_flctl.c @@ -398,7 +398,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; } -- 2.39.5