[MTD] NAND modularize write function

Modularize the write function and reorganaize the internal buffer
management. Remove obsolete chip options and fixup all affected
users.

Signed-off-by: Thomas Gleixner <[email protected]>
This commit is contained in:
Thomas Gleixner 2006-05-26 18:52:08 +02:00
commit f75e5097ef
7 changed files with 308 additions and 548 deletions

View file

@ -1666,7 +1666,7 @@ static int __init doc_probe(unsigned long physadr)
nand->ecc.mode = NAND_ECC_HW_SYNDROME;
nand->ecc.size = 512;
nand->ecc.bytes = 6;
nand->options = NAND_USE_FLASH_BBT | NAND_HWECC_SYNDROME;
nand->options = NAND_USE_FLASH_BBT;
doc->physadr = physadr;
doc->virtadr = virtadr;

View file

@ -198,9 +198,6 @@ static void __exit ep7312_cleanup(void)
/* Release resources, unregister device */
nand_release(ap7312_mtd);
/* Free internal data buffer */
kfree(this->data_buf);
/* Free the MTD device structure */
kfree(ep7312_mtd);
}

File diff suppressed because it is too large Load diff

View file

@ -666,7 +666,7 @@ static inline int nand_memory_bbt(struct mtd_info *mtd, struct nand_bbt_descr *b
struct nand_chip *this = mtd->priv;
bd->options &= ~NAND_BBT_SCANEMPTY;
return create_bbt(mtd, this->data_buf, bd, -1);
return create_bbt(mtd, this->buffers.databuf, bd, -1);
}
/**

View file

@ -571,7 +571,6 @@ static int __init rtc_from4_init(void)
this->ecc.mode = NAND_ECC_HW_SYNDROME;
this->ecc.size = 512;
this->ecc.bytes = 8;
this->options |= NAND_HWECC_SYNDROME;
/* return the status of extra status and ECC checks */
this->errstat = rtc_from4_errstat;
/* set the nand_oobinfo to support FPGA H/W error detection */

View file

@ -175,8 +175,6 @@ static int __init toto_init(void)
goto out;
out_buf:
kfree(this->data_buf);
out_mtd:
kfree(toto_mtd);
out: