diff options
author | Vitaly Wool <vwool@ru.mvista.com> | 2006-07-11 03:11:25 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@cruncher.tec.linutronix.de> | 2006-07-11 03:11:25 -0400 |
commit | 8b0036eefd7a96f23244b969417684c8627f5ad6 (patch) | |
tree | 765e2a201ebecdde7c89dc27e09f1a6038480eb2 /drivers/mtd/nand | |
parent | 90a18fab4ae07b77bf053b75a4d1285cd94faa79 (diff) |
[MTD] NAND: OOB buffer offset fixups
In the case of data-pad-ecc-pad-data... layout the oob start position
has to be sizeof(data) in nand_write_oob_syndrom().
In nand_fill_oob() we need to copy to buf + buffer offset instead of
buf + write offset.
From: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 62b861304e03..cffd66309ffa 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -1203,7 +1203,7 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd, | |||
1203 | pos = steps * (eccsize + chunk); | 1203 | pos = steps * (eccsize + chunk); |
1204 | steps = 0; | 1204 | steps = 0; |
1205 | } else | 1205 | } else |
1206 | pos = eccsize + chunk; | 1206 | pos = eccsize; |
1207 | 1207 | ||
1208 | chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page); | 1208 | chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page); |
1209 | for (i = 0; i < steps; i++) { | 1209 | for (i = 0; i < steps; i++) { |
@@ -1566,7 +1566,7 @@ static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob, | |||
1566 | bytes = min_t(size_t, len, free->length); | 1566 | bytes = min_t(size_t, len, free->length); |
1567 | boffs = free->offset; | 1567 | boffs = free->offset; |
1568 | } | 1568 | } |
1569 | memcpy(chip->oob_poi + woffs, oob, bytes); | 1569 | memcpy(chip->oob_poi + boffs, oob, bytes); |
1570 | oob += bytes; | 1570 | oob += bytes; |
1571 | } | 1571 | } |
1572 | return oob; | 1572 | return oob; |