[MTD] [OneNAND] Check the initial bad block using ONENAND_CTRL_ERROR
authorKyungmin Park <kyungmin.park@samsung.com>
Thu, 13 Dec 2007 00:39:29 +0000 (09:39 +0900)
committerKyungmin Park <kyungmin.park@samsung.com>
Tue, 29 Jan 2008 08:12:32 +0000 (17:12 +0900)
Some chips don't set the ONENAND_CTRL_LOAD bit.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
drivers/mtd/onenand/onenand_base.c

index cf8009329999e1fd9e61fd862278e628eefe2b3f..44c327a335e7d574b1e3abffacb042678d5db359 100644 (file)
@@ -1119,12 +1119,10 @@ static int onenand_bbt_wait(struct mtd_info *mtd, int state)
        interrupt = this->read_word(this->base + ONENAND_REG_INTERRUPT);
        ctrl = this->read_word(this->base + ONENAND_REG_CTRL_STATUS);
 
+       /* Initial bad block case: 0x2400 or 0x0400 */
        if (ctrl & ONENAND_CTRL_ERROR) {
                printk(KERN_DEBUG "onenand_bbt_wait: controller error = 0x%04x\n", ctrl);
-               /* Initial bad block case */
-               if (ctrl & ONENAND_CTRL_LOAD)
-                       return ONENAND_BBT_READ_ERROR;
-               return ONENAND_BBT_READ_FATAL_ERROR;
+               return ONENAND_BBT_READ_ERROR;
        }
 
        if (interrupt & ONENAND_INT_READ) {