aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorArtem B. Bityuckiy <dedekind@infradead.org>2005-02-09 09:50:00 -0500
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 06:31:01 -0400
commit41ce921440bd14d9b69b19fbf47d9278582739fe (patch)
treee1d2c0364c87295018a8c732cb294bb67d8210bf /drivers/mtd
parent0040bf382c77414739c933e4d2ee35ff817d0b99 (diff)
[MTD] NAND: Allow operation without bad block table
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nand_base.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 99abd615a467..1806ffae2452 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -59,7 +59,7 @@
59 * The AG-AND chips have nice features for speed improvement, 59 * The AG-AND chips have nice features for speed improvement,
60 * which are not supported yet. Read / program 4 pages in one go. 60 * which are not supported yet. Read / program 4 pages in one go.
61 * 61 *
62 * $Id: nand_base.c,v 1.131 2005/02/09 12:19:56 gleixner Exp $ 62 * $Id: nand_base.c,v 1.132 2005/02/09 14:49:56 dedekind Exp $
63 * 63 *
64 * This program is free software; you can redistribute it and/or modify 64 * This program is free software; you can redistribute it and/or modify
65 * it under the terms of the GNU General Public License version 2 as 65 * it under the terms of the GNU General Public License version 2 as
@@ -461,7 +461,8 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
461 461
462 /* Get block number */ 462 /* Get block number */
463 block = ((int) ofs) >> this->bbt_erase_shift; 463 block = ((int) ofs) >> this->bbt_erase_shift;
464 this->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1); 464 if (this->bbt)
465 this->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);
465 466
466 /* Do we have a flash based bad block table ? */ 467 /* Do we have a flash based bad block table ? */
467 if (this->options & NAND_USE_FLASH_BBT) 468 if (this->options & NAND_USE_FLASH_BBT)