mtd: introduce mtd_read interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:

committed by
David Woodhouse

부모
04c601bfa4
커밋
329ad399a9
@@ -214,7 +214,7 @@ static int read_eraseblock(int ebnum)
|
||||
int err = 0;
|
||||
loff_t addr = ebnum * mtd->erasesize;
|
||||
|
||||
err = mtd->read(mtd, addr, mtd->erasesize, &read, iobuf);
|
||||
err = mtd_read(mtd, addr, mtd->erasesize, &read, iobuf);
|
||||
/* Ignore corrected ECC errors */
|
||||
if (mtd_is_bitflip(err))
|
||||
err = 0;
|
||||
@@ -235,7 +235,7 @@ static int read_eraseblock_by_page(int ebnum)
|
||||
void *buf = iobuf;
|
||||
|
||||
for (i = 0; i < pgcnt; i++) {
|
||||
err = mtd->read(mtd, addr, pgsize, &read, buf);
|
||||
err = mtd_read(mtd, addr, pgsize, &read, buf);
|
||||
/* Ignore corrected ECC errors */
|
||||
if (mtd_is_bitflip(err))
|
||||
err = 0;
|
||||
@@ -261,7 +261,7 @@ static int read_eraseblock_by_2pages(int ebnum)
|
||||
void *buf = iobuf;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
err = mtd->read(mtd, addr, sz, &read, buf);
|
||||
err = mtd_read(mtd, addr, sz, &read, buf);
|
||||
/* Ignore corrected ECC errors */
|
||||
if (mtd_is_bitflip(err))
|
||||
err = 0;
|
||||
@@ -276,7 +276,7 @@ static int read_eraseblock_by_2pages(int ebnum)
|
||||
buf += sz;
|
||||
}
|
||||
if (pgcnt % 2) {
|
||||
err = mtd->read(mtd, addr, pgsize, &read, buf);
|
||||
err = mtd_read(mtd, addr, pgsize, &read, buf);
|
||||
/* Ignore corrected ECC errors */
|
||||
if (mtd_is_bitflip(err))
|
||||
err = 0;
|
||||
|
Reference in New Issue
Block a user