diff options
author | Maxim Levitsky <maximlevitsky@gmail.com> | 2010-02-22 13:39:37 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-02-26 13:00:08 -0500 |
commit | b64d39d8b03fea88417d53715ccbebf71d4dcc9f (patch) | |
tree | 1644c3aa53bc250171d19cc9c85b2ae8ca7e0a54 /drivers/mtd/nand/nand_base.c | |
parent | 782ce79a45b3b850b108896fcf7da26754061c8f (diff) |
mtd: nand: make reads using MTD_OOB_RAW affect only ECC validation
This changes the behavier of MTD_OOB_RAW. It used to read both OOB and
data to the data buffer, however you would still need to specify the
dummy oob buffer.
This is only used in one place, but makes it hard to read data+oob
without ECC test, thus I removed that behavier, and fixed the user.
Now MTD_OOB_RAW behaves just like MTD_OOB_PLACE, but doesn't do ECC
validation
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 138674183c1c..51dfea1b3ce6 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -1474,18 +1474,13 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from, | |||
1474 | 1474 | ||
1475 | if (unlikely(oob)) { | 1475 | if (unlikely(oob)) { |
1476 | 1476 | ||
1477 | /* Raw mode does data:oob:data:oob */ | 1477 | int toread = min(oobreadlen, max_oobsize); |
1478 | if (ops->mode != MTD_OOB_RAW) { | 1478 | |
1479 | int toread = min(oobreadlen, | 1479 | if (toread) { |
1480 | max_oobsize); | 1480 | oob = nand_transfer_oob(chip, |
1481 | if (toread) { | 1481 | oob, ops, toread); |
1482 | oob = nand_transfer_oob(chip, | 1482 | oobreadlen -= toread; |
1483 | oob, ops, toread); | 1483 | } |
1484 | oobreadlen -= toread; | ||
1485 | } | ||
1486 | } else | ||
1487 | buf = nand_transfer_oob(chip, | ||
1488 | buf, ops, mtd->oobsize); | ||
1489 | } | 1484 | } |
1490 | 1485 | ||
1491 | if (!(chip->options & NAND_NO_READRDY)) { | 1486 | if (!(chip->options & NAND_NO_READRDY)) { |