Commit 4f4fad27 authored by Kyungmin Park's avatar Kyungmin Park

[MTD] OneNAND: Remove line of code that was meant to be deleted in OOB_AUTO

- Iterations of the patch to add oob auto-placement support to OneNAND left a line of code that was meant to have been deleted.
- read mtd->oobsize in onenand_transfer_auto_oob to optimized memcpy
Signed-off-by: default avatarAdrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
parent a5e7c7b4
...@@ -810,8 +810,7 @@ static int onenand_transfer_auto_oob(struct mtd_info *mtd, uint8_t *buf, int col ...@@ -810,8 +810,7 @@ static int onenand_transfer_auto_oob(struct mtd_info *mtd, uint8_t *buf, int col
readend += free->offset - lastgap; readend += free->offset - lastgap;
lastgap = free->offset + free->length; lastgap = free->offset + free->length;
} }
this->read_bufferram(mtd, ONENAND_SPARERAM, oob_buf + readcol, this->read_bufferram(mtd, ONENAND_SPARERAM, oob_buf, 0, mtd->oobsize);
readcol, readend - readcol);
for (free = this->ecclayout->oobfree; free->length; ++free) { for (free = this->ecclayout->oobfree; free->length; ++free) {
int free_end = free->offset + free->length; int free_end = free->offset + free->length;
if (free->offset < readend && free_end > readcol) { if (free->offset < readend && free_end > readcol) {
...@@ -926,13 +925,12 @@ int onenand_do_read_oob(struct mtd_info *mtd, loff_t from, size_t len, ...@@ -926,13 +925,12 @@ int onenand_do_read_oob(struct mtd_info *mtd, loff_t from, size_t len,
static int onenand_read_oob(struct mtd_info *mtd, loff_t from, static int onenand_read_oob(struct mtd_info *mtd, loff_t from,
struct mtd_oob_ops *ops) struct mtd_oob_ops *ops)
{ {
switch (ops->mode) switch (ops->mode) {
{
case MTD_OOB_PLACE: case MTD_OOB_PLACE:
case MTD_OOB_AUTO: case MTD_OOB_AUTO:
break; break;
case MTD_OOB_RAW: case MTD_OOB_RAW:
return -EINVAL; /* Not implemented yet */ /* Not implemented yet */
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -1143,7 +1141,6 @@ static int onenand_fill_auto_oob(struct mtd_info *mtd, u_char *oob_buf, ...@@ -1143,7 +1141,6 @@ static int onenand_fill_auto_oob(struct mtd_info *mtd, u_char *oob_buf,
writeend += free->offset - lastgap; writeend += free->offset - lastgap;
lastgap = free->offset + free->length; lastgap = free->offset + free->length;
} }
writeend = mtd->oobsize;
for (free = this->ecclayout->oobfree; free->length; ++free) { for (free = this->ecclayout->oobfree; free->length; ++free) {
int free_end = free->offset + free->length; int free_end = free->offset + free->length;
if (free->offset < writeend && free_end > writecol) { if (free->offset < writeend && free_end > writecol) {
...@@ -1264,13 +1261,12 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len, ...@@ -1264,13 +1261,12 @@ static int onenand_do_write_oob(struct mtd_info *mtd, loff_t to, size_t len,
static int onenand_write_oob(struct mtd_info *mtd, loff_t to, static int onenand_write_oob(struct mtd_info *mtd, loff_t to,
struct mtd_oob_ops *ops) struct mtd_oob_ops *ops)
{ {
switch (ops->mode) switch (ops->mode) {
{
case MTD_OOB_PLACE: case MTD_OOB_PLACE:
case MTD_OOB_AUTO: case MTD_OOB_AUTO:
break; break;
case MTD_OOB_RAW: case MTD_OOB_RAW:
return -EINVAL; /* Not implemented yet */ /* Not implemented yet */
default: default:
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment