Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274945
b: refs/heads/master
c: 105513c
h: refs/heads/master
i:
  274943: a6508ab
v: v3
  • Loading branch information
Brian Norris authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 1540b49 commit cb8be03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 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: 3e2b82b9073e8bf0b4f359fa3045e81d9fe87f7d
refs/heads/master: 105513cc4a25522f959788371bd612f987d4d184
28 changes: 8 additions & 20 deletions trunk/drivers/mtd/nand/nand_bbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,28 +306,16 @@ static int scan_read_raw_oob(struct mtd_info *mtd, uint8_t *buf, loff_t offs,
ops.ooboffs = 0;
ops.ooblen = mtd->oobsize;


while (len > 0) {
if (len <= mtd->writesize) {
ops.oobbuf = buf + len;
ops.datbuf = buf;
ops.len = len;
res = mtd->read_oob(mtd, offs, &ops);

/* Ignore ECC errors when checking for BBM */
if (res != -EUCLEAN && res != -EBADMSG)
return res;
return 0;
} else {
ops.oobbuf = buf + mtd->writesize;
ops.datbuf = buf;
ops.len = mtd->writesize;
res = mtd->read_oob(mtd, offs, &ops);
ops.datbuf = buf;
ops.len = min(len, (size_t)mtd->writesize);
ops.oobbuf = buf + ops.len;

/* Ignore ECC errors when checking for BBM */
if (res && res != -EUCLEAN && res != -EBADMSG)
return res;
}
res = mtd->read_oob(mtd, offs, &ops);

/* Ignore ECC errors when checking for BBM */
if (res && res != -EUCLEAN && res != -EBADMSG)
return res;

buf += mtd->oobsize + mtd->writesize;
len -= mtd->writesize;
Expand Down

0 comments on commit cb8be03

Please sign in to comment.