Message ID | 4CC1A5EE.9080605@parrot.com |
---|---|
State | RFC |
Headers | show |
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c > index ddffe76..71052d0 100644 > --- a/drivers/mtd/nand/nand_base.c > +++ b/drivers/mtd/nand/nand_base.c > @@ -409,7 +409,10 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) > /* Do we have a flash based bad block table ? */ > if (chip->options & NAND_USE_FLASH_BBT) > ret = nand_update_bbt(mtd, ofs); > - else { > + /* put also the bad block marker in case we loose BBT or > + the bootloader doesn't support reading it > + */ Nitpick: please, use kernel commenting style: /* * Multi-line * comment */ > + { > nand_get_device(chip, mtd, FL_WRITING); I think this makes sense, but this may break some setups, so this should be yet another chip->option.
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index ddffe76..71052d0 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -409,7 +409,10 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs) /* Do we have a flash based bad block table ? */ if (chip->options & NAND_USE_FLASH_BBT) ret = nand_update_bbt(mtd, ofs); - else { + /* put also the bad block marker in case we loose BBT or + the bootloader doesn't support reading it + */ + { nand_get_device(chip, mtd, FL_WRITING); /* Write to first two pages and to byte 1 and 6 if necessary.