提交 82e1d19f 编写于 作者: D Dan Brown 提交者: Thomas Gleixner

[MTD] NAND: Fix reading of autoplaced OOB when there are multiple free sections.

Signed-off-by: NDan Brown <dan_brown@ieee.org>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 e5a3e8ca
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
* The AG-AND chips have nice features for speed improvement, * The AG-AND chips have nice features for speed improvement,
* which are not supported yet. Read / program 4 pages in one go. * which are not supported yet. Read / program 4 pages in one go.
* *
* $Id: nand_base.c,v 1.140 2005/04/04 18:56:29 gleixner Exp $ * $Id: nand_base.c,v 1.141 2005/04/06 20:13:05 dbrown Exp $
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
...@@ -1285,13 +1285,12 @@ int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, ...@@ -1285,13 +1285,12 @@ int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
switch(oobsel->useecc) { switch(oobsel->useecc) {
case MTD_NANDECC_AUTOPLACE: case MTD_NANDECC_AUTOPLACE:
/* Walk through the autoplace chunks */ /* Walk through the autoplace chunks */
for (i = 0, j = 0; j < mtd->oobavail; i++) { for (i = 0; oobsel->oobfree[i][1]; i++) {
int from = oobsel->oobfree[i][0]; int from = oobsel->oobfree[i][0];
int num = oobsel->oobfree[i][1]; int num = oobsel->oobfree[i][1];
memcpy(&oob_buf[oob], &oob_data[from], num); memcpy(&oob_buf[oob], &oob_data[from], num);
j+= num; oob += num;
} }
oob += mtd->oobavail;
break; break;
case MTD_NANDECC_PLACE: case MTD_NANDECC_PLACE:
/* YAFFS1 legacy mode */ /* YAFFS1 legacy mode */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册