]> git.karo-electronics.de Git - karo-tx-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)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 24 Aug 2012 08:03:34 +0000 (11:03 +0300)
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>
drivers/mtd/nand/sh_flctl.c

index e4f31ef0a11f7e0c9f9c9dc20a9431ee349edc28..0b798fbf902cd225d0969c9bbf625f5662e44919 100644 (file)
@@ -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;
 }