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

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 29 10:59:02 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=894824f9731a805b70b553220ae58e5475ff6ff1
Commit:     894824f9731a805b70b553220ae58e5475ff6ff1
Parent:     d76236f30f1280f9345bb266a161e3ba60518c83
Author:     Bastian Hecht <hechtb at googlemail.com>
AuthorDate: Thu Jul 5 12:41:02 2012 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sat Sep 29 14:49:38 2012 +0100

    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 at gmail.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/sh_flctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
index 1343315..4ff8ef5 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;
 }
 



More information about the linux-mtd-cvs mailing list