diff options
author | Vitaly Wool <vwool@ru.mvista.com> | 2006-09-16 15:15:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-16 15:54:32 -0400 |
commit | 96da96065bd66164acc3c8a1ea6db4ee765537e9 (patch) | |
tree | baa607c16c0cb2034cb9eb881fa840ad2f3ef2b5 /drivers | |
parent | 20acaa18d0c002fec180956f87adeb3f11f635a6 (diff) |
[PATCH] 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.
Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-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 c8cbc00243fe..0a54d003ef34 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -1204,7 +1204,7 @@ static int nand_write_oob_syndrome(struct mtd_info *mtd, | |||
1204 | pos = steps * (eccsize + chunk); | 1204 | pos = steps * (eccsize + chunk); |
1205 | steps = 0; | 1205 | steps = 0; |
1206 | } else | 1206 | } else |
1207 | pos = eccsize + chunk; | 1207 | pos = eccsize; |
1208 | 1208 | ||
1209 | chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page); | 1209 | chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page); |
1210 | for (i = 0; i < steps; i++) { | 1210 | for (i = 0; i < steps; i++) { |
@@ -1567,7 +1567,7 @@ static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob, | |||
1567 | bytes = min_t(size_t, len, free->length); | 1567 | bytes = min_t(size_t, len, free->length); |
1568 | boffs = free->offset; | 1568 | boffs = free->offset; |
1569 | } | 1569 | } |
1570 | memcpy(chip->oob_poi + woffs, oob, bytes); | 1570 | memcpy(chip->oob_poi + boffs, oob, bytes); |
1571 | oob += bytes; | 1571 | oob += bytes; |
1572 | } | 1572 | } |
1573 | return oob; | 1573 | return oob; |