aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyungmin Park <kyungmin.park@samsung.com>2005-09-03 02:36:21 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-06 15:24:51 -0500
commitd36d63d404b75ddf231da0dbd3640e6d1722b4ab (patch)
treefa04e066666c602de3090ff61feb576c13da5ff1
parent405c829f98d216925de00af2ee52f969f2c2891c (diff)
[PATCH] OneNAND: Fix bug in write verify
- Remove unused block, page parameters - Add constant instead of runtime value Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--drivers/mtd/onenand/onenand_base.c11
-rw-r--r--include/linux/mtd/onenand.h1
2 files changed, 5 insertions, 7 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index bdeac01e659f..75d757882697 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -719,13 +719,10 @@ out:
719 * onenand_verify_page - [GENERIC] verify the chip contents after a write 719 * onenand_verify_page - [GENERIC] verify the chip contents after a write
720 * @param mtd MTD device structure 720 * @param mtd MTD device structure
721 * @param buf the databuffer to verify 721 * @param buf the databuffer to verify
722 * @param block block address
723 * @param page page address
724 * 722 *
725 * Check DataRAM area directly 723 * Check DataRAM area directly
726 */ 724 */
727static int onenand_verify_page(struct mtd_info *mtd, u_char *buf, 725static int onenand_verify_page(struct mtd_info *mtd, u_char *buf, loff_t addr)
728 loff_t addr, int block, int page)
729{ 726{
730 struct onenand_chip *this = mtd->priv; 727 struct onenand_chip *this = mtd->priv;
731 void __iomem *dataram0, *dataram1; 728 void __iomem *dataram0, *dataram1;
@@ -816,7 +813,7 @@ static int onenand_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
816 written += thislen; 813 written += thislen;
817 814
818 /* Only check verify write turn on */ 815 /* Only check verify write turn on */
819 ret = onenand_verify_page(mtd, (u_char *) buf, to, block, page); 816 ret = onenand_verify_page(mtd, (u_char *) buf, to);
820 if (ret) { 817 if (ret) {
821 DEBUG(MTD_DEBUG_LEVEL0, "onenand_write_ecc: verify failed %d\n", ret); 818 DEBUG(MTD_DEBUG_LEVEL0, "onenand_write_ecc: verify failed %d\n", ret);
822 goto out; 819 goto out;
@@ -940,7 +937,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
940 u_char *eccbuf, struct nand_oobinfo *oobsel) 937 u_char *eccbuf, struct nand_oobinfo *oobsel)
941{ 938{
942 struct onenand_chip *this = mtd->priv; 939 struct onenand_chip *this = mtd->priv;
943 unsigned char buffer[mtd->oobblock], *pbuf; 940 unsigned char buffer[MAX_ONENAND_PAGESIZE], *pbuf;
944 size_t total_len, len; 941 size_t total_len, len;
945 int i, written = 0; 942 int i, written = 0;
946 int ret = 0; 943 int ret = 0;
@@ -1025,7 +1022,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
1025 1022
1026 1023
1027 /* Only check verify write turn on */ 1024 /* Only check verify write turn on */
1028 ret = onenand_verify_page(mtd, (u_char *) pbuf, to, block, page); 1025 ret = onenand_verify_page(mtd, (u_char *) pbuf, to);
1029 if (ret) { 1026 if (ret) {
1030 DEBUG(MTD_DEBUG_LEVEL0, "onenand_writev_ecc: verify failed %d\n", ret); 1027 DEBUG(MTD_DEBUG_LEVEL0, "onenand_writev_ecc: verify failed %d\n", ret);
1031 goto out; 1028 goto out;
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 2c29a5ca2c91..58023082320a 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -17,6 +17,7 @@
17#include <linux/mtd/bbm.h> 17#include <linux/mtd/bbm.h>
18 18
19#define MAX_BUFFERRAM 2 19#define MAX_BUFFERRAM 2
20#define MAX_ONENAND_PAGESIZE (2048 + 64)
20 21
21/* Scan and identify a OneNAND device */ 22/* Scan and identify a OneNAND device */
22extern int onenand_scan(struct mtd_info *mtd, int max_chips); 23extern int onenand_scan(struct mtd_info *mtd, int max_chips);