mtd/drivers/mtd/nand nand_bbt.c,1.26,1.27

gleixner at infradead.org gleixner at infradead.org
Fri Nov 12 05:40:39 EST 2004


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

Modified Files:
	nand_bbt.c 
Log Message:
Allow board drivers to provide their own scan pattern for bad block scanning

Index: nand_bbt.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_bbt.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- nand_bbt.c	5 Oct 2004 13:50:20 -0000	1.26
+++ nand_bbt.c	12 Nov 2004 10:40:36 -0000	1.27
@@ -1001,25 +1001,23 @@
 		return nand_scan_bbt (mtd, &agand_flashbased);
 	}
 	
+	if (!this->badblock_pattern) {
+		this->badblock_pattern = (mtd->oobblock > 512) ?
+			&largepage_flashbased : &smallpage_flashbased;
+	}
+	
 	/* Is a flash based bad block table requested ? */
 	if (this->options & NAND_USE_FLASH_BBT) {
 		/* Use the default pattern descriptors */	
 		if (!this->bbt_td) {	
 			this->bbt_td = &bbt_main_descr;
 			this->bbt_md = &bbt_mirror_descr;
-		}	
-		if (mtd->oobblock > 512)
-			return nand_scan_bbt (mtd, &largepage_flashbased);
-		else	
-			return nand_scan_bbt (mtd, &smallpage_flashbased);			
+		}
 	} else {
 		this->bbt_td = NULL;
 		this->bbt_md = NULL;
-		if (mtd->oobblock > 512)
-			return nand_scan_bbt (mtd, &largepage_memorybased);
-		else
-			return nand_scan_bbt (mtd, &smallpage_memorybased);
 	}
+	return nand_scan_bbt (mtd, this->badblock_pattern);
 }
 
 /**





More information about the linux-mtd-cvs mailing list