Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165487
b: refs/heads/master
c: 0f777fb
h: refs/heads/master
i:
  165485: 9e4c0c3
  165483: 536934f
  165479: e402174
  165471: aac050a
v: v3
  • Loading branch information
Atsushi Nemoto authored and David Woodhouse committed Sep 19, 2009
1 parent 151cdae commit dfeef78
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 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: be2f092bfc4f6a415bb4c3e2dcbf521a1f2a0fe5
refs/heads/master: 0f777fb9318739baf517c4f4ef66347d8898643d
17 changes: 16 additions & 1 deletion trunk/drivers/mtd/nand/tmio_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,21 @@ static int tmio_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
return 0;
}

static int tmio_nand_correct_data(struct mtd_info *mtd, unsigned char *buf,
unsigned char *read_ecc, unsigned char *calc_ecc)
{
int r0, r1;

/* assume ecc.size = 512 and ecc.bytes = 6 */
r0 = __nand_correct_data(buf, read_ecc, calc_ecc, 256);
if (r0 < 0)
return r0;
r1 = __nand_correct_data(buf + 256, read_ecc + 3, calc_ecc + 3, 256);
if (r1 < 0)
return r1;
return r0 + r1;
}

static int tmio_hw_init(struct platform_device *dev, struct tmio_nand *tmio)
{
struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data;
Expand Down Expand Up @@ -424,7 +439,7 @@ static int tmio_probe(struct platform_device *dev)
nand_chip->ecc.bytes = 6;
nand_chip->ecc.hwctl = tmio_nand_enable_hwecc;
nand_chip->ecc.calculate = tmio_nand_calculate_ecc;
nand_chip->ecc.correct = nand_correct_data;
nand_chip->ecc.correct = tmio_nand_correct_data;

if (data)
nand_chip->badblock_pattern = data->badblock_pattern;
Expand Down

0 comments on commit dfeef78

Please sign in to comment.