mtd/drivers/mtd/nand nand_bbt.c,1.2,1.3

gleixner at infradead.org gleixner at infradead.org
Wed May 26 17:02:32 EDT 2004


Update of /home/cvs/mtd/drivers/mtd/nand
In directory phoenix.infradead.org:/tmp/cvs-serv13655

Modified Files:
	nand_bbt.c 
Log Message:
Fix return value in case nothing else modifies it.Add debug output. Signed-off-by: Thomas Gleixner <tglx at linutronix.de>

Index: nand_bbt.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_bbt.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nand_bbt.c	26 May 2004 18:05:56 -0000	1.2
+++ nand_bbt.c	26 May 2004 21:02:30 -0000	1.3
@@ -139,6 +139,8 @@
 				uint8_t tmp = (dat >> j) & msk;
 				if (tmp == msk)
 					continue;
+				DEBUG (MTD_DEBUG_LEVEL0, "nand_read_bbt: Bad block at 0x%08x\n",
+					((offs << 2) + (act >> 1)) << this->erase_shift);
 				/* Factory marked bad or worn out ? */	
 				if (tmp == 0)
 					this->bbt[offs + (act >> 3)] |= 0x3 << (act & 0x06);
@@ -622,7 +624,11 @@
 	case 2: writeops |= 0x02; goto writecheck;
 	case 3: writeops |= 0x03; break;
 	default: goto out;
-	}				
+	}
+	/* Reset return value, as it could happen that it is not touched
+	 * anymore 
+	*/
+	res = 0;
 
 	/* Create the bad block table by scanning the device */
 	if (td->options & NAND_BBT_CREATE)





More information about the linux-mtd-cvs mailing list