mtd/drivers/mtd nftlcore.c,1.86,1.87 nftlmount.c,1.28,1.29
David Woodhouse
dwmw2 at infradead.org
Fri Sep 13 10:35:35 EDT 2002
Update of /home/cvs/mtd/drivers/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv4362/drivers/mtd
Modified Files:
nftlcore.c nftlmount.c
Log Message:
Fix NFTL build.
Index: nftlcore.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nftlcore.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- nftlcore.c 6 Mar 2002 14:38:17 -0000 1.86
+++ nftlcore.c 13 Sep 2002 14:35:33 -0000 1.87
@@ -29,6 +29,7 @@
#include <linux/kmod.h>
#endif
#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
#include <linux/mtd/nftl.h>
#include <linux/mtd/compatmac.h>
@@ -152,7 +153,7 @@
if (nftl->nr_sects != nftl->heads * nftl->cylinders * nftl->sectors) {
printk(KERN_WARNING "Cannot calculate an NFTL geometry to "
- "match size of 0x%lx.\n", nftl->nr_sects);
+ "match size of 0x%x.\n", nftl->nr_sects);
printk(KERN_WARNING "Using C:%d H:%d S:%d (== 0x%lx sects)\n",
nftl->cylinders, nftl->heads , nftl->sectors,
(long)nftl->cylinders * (long)nftl->heads * (long)nftl->sectors );
@@ -443,17 +444,17 @@
if (BlockMap[block] == BLOCK_NIL)
continue;
- ret = MTD_READECC(nftl->mtd, (nftl->EraseSize * BlockMap[block])
- + (block * 512), 512, &retlen, movebuf, (char *)&oob);
+ ret = MTD_READECC(nftl->mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512),
+ 512, &retlen, movebuf, (char *)&oob, NAND_ECC_DISKONCHIP);
if (ret < 0) {
ret = MTD_READECC(nftl->mtd, (nftl->EraseSize * BlockMap[block])
+ (block * 512), 512, &retlen,
- movebuf, (char *)&oob);
+ movebuf, (char *)&oob, NAND_ECC_DISKONCHIP);
if (ret != -EIO)
printk("Error went away on retry.\n");
}
MTD_WRITEECC(nftl->mtd, (nftl->EraseSize * targetEUN) + (block * 512),
- 512, &retlen, movebuf, (char *)&oob);
+ 512, &retlen, movebuf, (char *)&oob, NAND_ECC_DISKONCHIP);
}
/* add the header so that it is now a valid chain */
@@ -720,7 +721,7 @@
}
MTD_WRITEECC(nftl->mtd, (writeEUN * nftl->EraseSize) + blockofs,
- 512, &retlen, (char *)buffer, (char *)eccbuf);
+ 512, &retlen, (char *)buffer, (char *)eccbuf, NAND_ECC_DISKONCHIP);
/* no need to write SECTOR_USED flags since they are written in mtd_writeecc */
return 0;
@@ -782,7 +783,7 @@
loff_t ptr = (lastgoodEUN * nftl->EraseSize) + blockofs;
size_t retlen;
u_char eccbuf[6];
- if (MTD_READECC(nftl->mtd, ptr, 512, &retlen, buffer, eccbuf))
+ if (MTD_READECC(nftl->mtd, ptr, 512, &retlen, buffer, eccbuf, NAND_ECC_DISKONCHIP))
return -EIO;
}
return 0;
Index: nftlmount.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nftlmount.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- nftlmount.c 13 Mar 2002 07:31:25 -0000 1.28
+++ nftlmount.c 13 Sep 2002 14:35:33 -0000 1.29
@@ -34,6 +34,7 @@
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
#include <linux/mtd/nftl.h>
#include <linux/mtd/compatmac.h>
@@ -112,7 +113,7 @@
/* Finally reread to check ECC */
if ((ret = MTD_READECC(nftl->mtd, block * nftl->EraseSize, SECTORSIZE,
- &retlen, buf, (char *)&oob) < 0)) {
+ &retlen, buf, (char *)&oob, NAND_ECC_DISKONCHIP) < 0)) {
printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but ECC read failed (err %d)\n",
block * nftl->EraseSize, nftl->mtd->index, ret);
continue;
@@ -220,8 +221,8 @@
if ((i & (SECTORSIZE - 1)) == 0) {
/* read one sector for every SECTORSIZE of blocks */
if ((ret = MTD_READECC(nftl->mtd, block * nftl->EraseSize +
- i + SECTORSIZE, SECTORSIZE,
- &retlen, buf, (char *)&oob)) < 0) {
+ i + SECTORSIZE, SECTORSIZE, &retlen, buf,
+ (char *)&oob, NAND_ECC_DISKONCHIP)) < 0) {
printk(KERN_NOTICE "Read of bad sector table failed (err %d)\n",
ret);
kfree(nftl->ReplUnitTable);
More information about the linux-mtd-cvs
mailing list