diff options
author | Ricard Wanderlöf <ricard.wanderlof@axis.com> | 2006-10-23 03:33:34 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-10-26 06:17:49 -0400 |
commit | ff0dab64b4e9ce3a073365342297e76ddaae9697 (patch) | |
tree | dd4fd58aa67ea594a3a1c5a52f3faa9797800f47 /drivers/mtd/nand/nand_base.c | |
parent | 784f4d5e66ac1d962091e08fe5a4b238ed8c793d (diff) |
[MTD] NAND: Fix nand_default_mark_blockbad() when flash-based BBT disabled
When a flash-based BBT is not used, nand_default_mark_blockbad() is supposed
to mark the block bad in the oob. However, it sets the wrong length variable
so that no bad block marker is in fact written. This patch attempts to
rectify that.
(As note, it seems to be that logically, it shouldn't be necessary to set
both length variables, as one appears to be for the main buffer, and
one for the oob buffer, but this is how it is done in several places,
including the code for the mtd character device MEMWRITEOOB and MEMREADOOB
ioctls. I'm not sure if this is a temporary solution during some rework of
the mtd infrastructure, or whether there is a deeper thought here.)
Signed-off-by: Ricard Wanderlöf <ricardw@axis.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index f23ab2c70433..8df36e2c9a53 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -362,7 +362,7 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) | |||
362 | * access | 362 | * access |
363 | */ | 363 | */ |
364 | ofs += mtd->oobsize; | 364 | ofs += mtd->oobsize; |
365 | chip->ops.len = 2; | 365 | chip->ops.len = chip->ops.ooblen = 2; |
366 | chip->ops.datbuf = NULL; | 366 | chip->ops.datbuf = NULL; |
367 | chip->ops.oobbuf = buf; | 367 | chip->ops.oobbuf = buf; |
368 | chip->ops.ooboffs = chip->badblockpos & ~0x01; | 368 | chip->ops.ooboffs = chip->badblockpos & ~0x01; |