Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310209
b: refs/heads/master
c: e2788c9
h: refs/heads/master
i:
  310207: d3a6959
v: v3
  • Loading branch information
Mike Dunn authored and David Woodhouse committed May 14, 2012
1 parent cb67fad commit af11201
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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: 3f91e94f7f511de74c0d2abe08672ccdbdd1961c
refs/heads/master: e2788c98b98269a3131bffd2b57599280d7abd73
9 changes: 7 additions & 2 deletions trunk/drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -3348,8 +3348,13 @@ int nand_scan_tail(struct mtd_info *mtd)
if (!chip->ecc.write_oob)
chip->ecc.write_oob = nand_write_oob_syndrome;

if (mtd->writesize >= chip->ecc.size)
if (mtd->writesize >= chip->ecc.size) {
if (!chip->ecc.strength) {
pr_warn("Driver must set ecc.strength when using hardware ECC\n");
BUG();
}
break;
}
pr_warn("%d byte HW ECC not possible on "
"%d byte page size, fallback to SW ECC\n",
chip->ecc.size, mtd->writesize);
Expand Down Expand Up @@ -3404,7 +3409,7 @@ int nand_scan_tail(struct mtd_info *mtd)
BUG();
}
chip->ecc.strength =
chip->ecc.bytes*8 / fls(8*chip->ecc.size);
chip->ecc.bytes * 8 / fls(8 * chip->ecc.size);
break;

case NAND_ECC_NONE:
Expand Down

0 comments on commit af11201

Please sign in to comment.