aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKyungmin Park <kyungmin.park@samsung.com>2007-12-14 00:47:21 -0500
committerKyungmin Park <kyungmin.park@samsung.com>2008-01-29 03:14:01 -0500
commit69d79186dc48ca22a0ce69511bef8ef6c2465ada (patch)
tree79c4f4a0b363ae2ddd080102862027be6e44a92b /drivers
parent978cb38a296fceac82a8a757f6387d7ef2a21ac6 (diff)
[MTD] [OneNAND] Use pre-alloced oob buffer instead of local buffer
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/onenand/onenand_base.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index ad052c8233c2..b281b116aaeb 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1217,7 +1217,7 @@ int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
1217static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to) 1217static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to)
1218{ 1218{
1219 struct onenand_chip *this = mtd->priv; 1219 struct onenand_chip *this = mtd->priv;
1220 u_char oobbuf[64]; 1220 u_char *oob_buf = this->oob_buf;
1221 int status, i; 1221 int status, i;
1222 1222
1223 this->command(mtd, ONENAND_CMD_READOOB, to, mtd->oobsize); 1223 this->command(mtd, ONENAND_CMD_READOOB, to, mtd->oobsize);
@@ -1226,9 +1226,9 @@ static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to
1226 if (status) 1226 if (status)
1227 return status; 1227 return status;
1228 1228
1229 this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, 0, mtd->oobsize); 1229 this->read_bufferram(mtd, ONENAND_SPARERAM, oob_buf, 0, mtd->oobsize);
1230 for (i = 0; i < mtd->oobsize; i++) 1230 for (i = 0; i < mtd->oobsize; i++)
1231 if (buf[i] != 0xFF && buf[i] != oobbuf[i]) 1231 if (buf[i] != 0xFF && buf[i] != oob_buf[i])
1232 return -EBADMSG; 1232 return -EBADMSG;
1233 1233
1234 return 0; 1234 return 0;
@@ -2307,7 +2307,8 @@ static int onenand_write_user_prot_reg(struct mtd_info *mtd, loff_t from,
2307static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, 2307static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
2308 size_t len) 2308 size_t len)
2309{ 2309{
2310 unsigned char oob_buf[64]; 2310 struct onenand_chip *this = mtd->priv;
2311 u_char *oob_buf = this->oob_buf;
2311 size_t retlen; 2312 size_t retlen;
2312 int ret; 2313 int ret;
2313 2314