diff options
author | Brian Norris <computersforpeace@gmail.com> | 2012-05-02 13:15:03 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-05-14 00:21:57 -0400 |
commit | 279f08d4ef6548be4e2fa638245adebc77436e54 (patch) | |
tree | fd3e1587109063069206bf1825459be891e3a6f1 /drivers/mtd | |
parent | 7725cc85932bd02dd12c23108e0ef748c551ccba (diff) |
mtd: nand: utilize oob_required parameter
Don't read/write OOB if the caller doesn't require it.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 464b742431ed..14e9b32ed8c7 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -1075,7 +1075,8 @@ static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, | |||
1075 | uint8_t *buf, int oob_required, int page) | 1075 | uint8_t *buf, int oob_required, int page) |
1076 | { | 1076 | { |
1077 | chip->read_buf(mtd, buf, mtd->writesize); | 1077 | chip->read_buf(mtd, buf, mtd->writesize); |
1078 | chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); | 1078 | if (oob_required) |
1079 | chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); | ||
1079 | return 0; | 1080 | return 0; |
1080 | } | 1081 | } |
1081 | 1082 | ||
@@ -1928,7 +1929,8 @@ static void nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, | |||
1928 | const uint8_t *buf, int oob_required) | 1929 | const uint8_t *buf, int oob_required) |
1929 | { | 1930 | { |
1930 | chip->write_buf(mtd, buf, mtd->writesize); | 1931 | chip->write_buf(mtd, buf, mtd->writesize); |
1931 | chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); | 1932 | if (oob_required) |
1933 | chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); | ||
1932 | } | 1934 | } |
1933 | 1935 | ||
1934 | /** | 1936 | /** |