]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mtd: sh_flctl: Only copy OOB data if it is required
authorBastian Hecht <hechtb@googlemail.com>
Thu, 5 Jul 2012 10:41:02 +0000 (12:41 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 29 Sep 2012 13:49:38 +0000 (14:49 +0100)
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>
drivers/mtd/nand/sh_flctl.c

index 1343315b37bad2027c3db52d94eb7ec2a716612f..4ff8ef526c02df7e04be0645a76fd6fa326fb0b9 100644 (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;
 }