Skip to content

Commit

Permalink
[MTD] NAND: Allow operation without bad block table
Browse files Browse the repository at this point in the history
Small bugfix. Sometimes it may be handy not to have bbt.
So, this->bbt might be NULL.

Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Artem B. Bityuckiy authored and Thomas Gleixner committed May 23, 2005
1 parent 0040bf3 commit 41ce921
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
* The AG-AND chips have nice features for speed improvement,
* which are not supported yet. Read / program 4 pages in one go.
*
* $Id: nand_base.c,v 1.131 2005/02/09 12:19:56 gleixner Exp $
* $Id: nand_base.c,v 1.132 2005/02/09 14:49:56 dedekind Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand Down Expand Up @@ -461,7 +461,8 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)

/* Get block number */
block = ((int) ofs) >> this->bbt_erase_shift;
this->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);
if (this->bbt)
this->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);

/* Do we have a flash based bad block table ? */
if (this->options & NAND_USE_FLASH_BBT)
Expand Down

0 comments on commit 41ce921

Please sign in to comment.