Skip to content

Commit

Permalink
[PATCH] OneNAND: Fix bug in write verify
Browse files Browse the repository at this point in the history
- Remove unused block, page parameters
- Add constant instead of runtime value

Signed-off-by: Kyungmin Park <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
kyungmin-park authored and Thomas Gleixner committed Nov 6, 2005
1 parent 405c829 commit d36d63d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,13 +719,10 @@ static int onenand_read_oob(struct mtd_info *mtd, loff_t from, size_t len,
* onenand_verify_page - [GENERIC] verify the chip contents after a write
* @param mtd MTD device structure
* @param buf the databuffer to verify
* @param block block address
* @param page page address
*
* Check DataRAM area directly
*/
static int onenand_verify_page(struct mtd_info *mtd, u_char *buf,
loff_t addr, int block, int page)
static int onenand_verify_page(struct mtd_info *mtd, u_char *buf, loff_t addr)
{
struct onenand_chip *this = mtd->priv;
void __iomem *dataram0, *dataram1;
Expand Down Expand Up @@ -816,7 +813,7 @@ static int onenand_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
written += thislen;

/* Only check verify write turn on */
ret = onenand_verify_page(mtd, (u_char *) buf, to, block, page);
ret = onenand_verify_page(mtd, (u_char *) buf, to);
if (ret) {
DEBUG(MTD_DEBUG_LEVEL0, "onenand_write_ecc: verify failed %d\n", ret);
goto out;
Expand Down Expand Up @@ -940,7 +937,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
u_char *eccbuf, struct nand_oobinfo *oobsel)
{
struct onenand_chip *this = mtd->priv;
unsigned char buffer[mtd->oobblock], *pbuf;
unsigned char buffer[MAX_ONENAND_PAGESIZE], *pbuf;
size_t total_len, len;
int i, written = 0;
int ret = 0;
Expand Down Expand Up @@ -1025,7 +1022,7 @@ static int onenand_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,


/* Only check verify write turn on */
ret = onenand_verify_page(mtd, (u_char *) pbuf, to, block, page);
ret = onenand_verify_page(mtd, (u_char *) pbuf, to);
if (ret) {
DEBUG(MTD_DEBUG_LEVEL0, "onenand_writev_ecc: verify failed %d\n", ret);
goto out;
Expand Down
1 change: 1 addition & 0 deletions include/linux/mtd/onenand.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/mtd/bbm.h>

#define MAX_BUFFERRAM 2
#define MAX_ONENAND_PAGESIZE (2048 + 64)

/* Scan and identify a OneNAND device */
extern int onenand_scan(struct mtd_info *mtd, int max_chips);
Expand Down

0 comments on commit d36d63d

Please sign in to comment.