Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310219
b: refs/heads/master
c: e47f3db
h: refs/heads/master
i:
  310217: 757bdbe
  310215: 3c4ef05
v: v3
  • Loading branch information
Brian Norris authored and David Woodhouse committed May 14, 2012
1 parent eb5456e commit 4c5de6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1fbb938dff5b6bb4514a4e7600276b03c7f08e25
refs/heads/master: e47f3db4587c5486d3d5838fd4bef4f9c3b12205
14 changes: 8 additions & 6 deletions trunk/drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ static uint8_t *nand_transfer_oob(struct nand_chip *chip, uint8_t *oob,
static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
struct mtd_oob_ops *ops)
{
int chipnr, page, realpage, col, bytes, aligned;
int chipnr, page, realpage, col, bytes, aligned, oob_required;
struct nand_chip *chip = mtd->priv;
struct mtd_ecc_stats stats;
int ret = 0;
Expand All @@ -1504,6 +1504,7 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,

buf = ops->datbuf;
oob = ops->oobbuf;
oob_required = oob ? 1 : 0;

while (1) {
bytes = min(mtd->writesize - col, readlen);
Expand All @@ -1521,13 +1522,14 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
*/
if (unlikely(ops->mode == MTD_OPS_RAW))
ret = chip->ecc.read_page_raw(mtd, chip, bufpoi,
1, page);
oob_required,
page);
else if (!aligned && NAND_SUBPAGE_READ(chip) && !oob)
ret = chip->ecc.read_subpage(mtd, chip,
col, bytes, bufpoi);
else
ret = chip->ecc.read_page(mtd, chip, bufpoi,
1, page);
oob_required, page);
if (ret < 0) {
if (!aligned)
/* Invalidate page cache */
Expand All @@ -1554,7 +1556,6 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
buf += bytes;

if (unlikely(oob)) {

int toread = min(oobreadlen, max_oobsize);

if (toread) {
Expand Down Expand Up @@ -2213,6 +2214,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
uint8_t *oob = ops->oobbuf;
uint8_t *buf = ops->datbuf;
int ret, subpage;
int oob_required = oob ? 1 : 0;

ops->retlen = 0;
if (!writelen)
Expand Down Expand Up @@ -2275,8 +2277,8 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
memset(chip->oob_poi, 0xff, mtd->oobsize);
}

ret = chip->write_page(mtd, chip, wbuf, 1, page, cached,
(ops->mode == MTD_OPS_RAW));
ret = chip->write_page(mtd, chip, wbuf, oob_required, page,
cached, (ops->mode == MTD_OPS_RAW));
if (ret)
break;

Expand Down

0 comments on commit 4c5de6c

Please sign in to comment.