aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorKyungmin Park <kyungmin.park@samsung.com>2007-12-14 14:47:21 +0900
committerKyungmin Park <kyungmin.park@samsung.com>2008-01-29 17:14:01 +0900
commit69d79186dc48ca22a0ce69511bef8ef6c2465ada (patch)
tree79c4f4a0b363ae2ddd080102862027be6e44a92b /drivers/mtd
parent978cb38a296fceac82a8a757f6387d7ef2a21ac6 (diff)
downloadkernel_goldelico_gta04-69d79186dc48ca22a0ce69511bef8ef6c2465ada.zip
kernel_goldelico_gta04-69d79186dc48ca22a0ce69511bef8ef6c2465ada.tar.gz
kernel_goldelico_gta04-69d79186dc48ca22a0ce69511bef8ef6c2465ada.tar.bz2
[MTD] [OneNAND] Use pre-alloced oob buffer instead of local buffer
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/mtd')
-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 ad052c8..b281b11 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,
static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to)
{
struct onenand_chip *this = mtd->priv;
- u_char oobbuf[64];
+ u_char *oob_buf = this->oob_buf;
int status, i;
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
if (status)
return status;
- this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, 0, mtd->oobsize);
+ this->read_bufferram(mtd, ONENAND_SPARERAM, oob_buf, 0, mtd->oobsize);
for (i = 0; i < mtd->oobsize; i++)
- if (buf[i] != 0xFF && buf[i] != oobbuf[i])
+ if (buf[i] != 0xFF && buf[i] != oob_buf[i])
return -EBADMSG;
return 0;
@@ -2307,7 +2307,8 @@ static int onenand_write_user_prot_reg(struct mtd_info *mtd, loff_t from,
static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
size_t len)
{
- unsigned char oob_buf[64];
+ struct onenand_chip *this = mtd->priv;
+ u_char *oob_buf = this->oob_buf;
size_t retlen;
int ret;