tree e1d2c0364c87295018a8c732cb294bb67d8210bf
parent 0040bf382c77414739c933e4d2ee35ff817d0b99
author Artem B. Bityuckiy <[EMAIL PROTECTED]> Wed, 09 Feb 2005 14:50:00 +0000
committer Thomas Gleixner <[EMAIL PROTECTED]> Mon, 23 May 2005 12:31:01 +0200

[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 <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

 drivers/mtd/nand/nand_base.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -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
@@ -461,7 +461,8 @@ static int nand_default_block_markbad(st
        
        /* 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)
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to