mtd/drivers/mtd/nand autcpu12.c,1.14,1.15

gleixner at infradead.org gleixner at infradead.org
Wed May 26 09:36:40 EDT 2004


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

Modified Files:
	autcpu12.c 
Log Message:
Make use of new features. Signed-off-by: Thomas Gleixner <tglx at linutronix.de>

Index: autcpu12.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/autcpu12.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- autcpu12.c	14 Apr 2004 19:00:56 -0000	1.14
+++ autcpu12.c	26 May 2004 13:36:38 -0000	1.15
@@ -141,10 +141,6 @@
 
 }
 
-/* Internal buffers. Page buffer and oob buffer for one block*/
-static u_char data_buf[512 + 16];
-static u_char oob_buf[16 * 32];
-
 /*
  * Main initialization routine
  */
@@ -189,10 +185,11 @@
 	this->chip_delay = 20;		
 	this->eccmode = NAND_ECC_SOFT;
 
-	/* Set internal data buffer */
-	this->data_buf = data_buf;
-	this->oob_buf = oob_buf;
-
+	/* Enable the following for a flash based bad block table */
+	/*
+	this->options = NAND_USE_FLASH_BBT;
+	*/
+	
 	/* Scan to find existance of the device */
 	if (nand_scan (autcpu12_mtd, 1)) {
 		err = -ENXIO;
@@ -200,7 +197,7 @@
 	}
 	
 	/* Register the partitions */
-	switch(autcpu12_mtd->size){
+	switch(autcpu12_mtd->size + this->bbt_size){
 		case SZ_16M: add_mtd_partitions(autcpu12_mtd, partition_info16k, NUM_PARTITIONS16K); break;
 		case SZ_32M: add_mtd_partitions(autcpu12_mtd, partition_info32k, NUM_PARTITIONS32K); break;
 		case SZ_64M: add_mtd_partitions(autcpu12_mtd, partition_info64k, NUM_PARTITIONS64K); break; 
@@ -229,17 +226,12 @@
 #ifdef MODULE
 static void __exit autcpu12_cleanup (void)
 {
-	struct nand_chip *this = (struct nand_chip *) &autcpu12_mtd[1];
-
-	/* Unregister partitions */
-	del_mtd_partitions(autcpu12_mtd);
-	
-	/* Unregister the device */
-	del_mtd_device (autcpu12_mtd);
+	/* Release resources, unregister device */
+	nand_release (autcpu12_mtd);
 
 	/* unmap physical adress */
 	iounmap((void *)autcpu12_fio_base);
-
+	
 	/* Free the MTD device structure */
 	kfree (autcpu12_mtd);
 }





More information about the linux-mtd-cvs mailing list