[PATCH 4/5] backport mtd api change to ubi

Mike Dunn mikedunn at newsguy.com
Mon Nov 28 20:04:28 EST 2011


Backport of the mtd api change to UBI.  Just adheres to the api, doesn't do
anything with it.

Signed-off-by: Mike Dunn <mikedunn at newsguy.com>
---
 drivers/mtd/ubi/io.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index f20b6f2..b082b58 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -135,6 +135,7 @@ int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
 	int err, retries = 0;
 	size_t read;
 	loff_t addr;
+	unsigned int max_bitflips;
 
 	dbg_io("read %d bytes from PEB %d:%d", len, pnum, offset);
 
@@ -170,7 +171,7 @@ int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
 
 	addr = (loff_t)pnum * ubi->peb_size + offset;
 retry:
-	err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf);
+	err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf, &max_bitflips);
 	if (err) {
 		const char *errstr = mtd_is_eccerr(err) ? " (ECC error)" : "";
 
@@ -1346,6 +1347,7 @@ int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
 	int err, i;
 	size_t read;
 	void *buf1;
+	unsigned int max_bitflips;
 	loff_t addr = (loff_t)pnum * ubi->peb_size + offset;
 
 	if (!ubi->dbg->chk_io)
@@ -1357,7 +1359,7 @@ int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
 		return 0;
 	}
 
-	err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf1);
+	err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf1, &max_bitflips);
 	if (err && !mtd_is_bitflip(err))
 		goto out_free;
 
@@ -1410,6 +1412,7 @@ int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len)
 	size_t read;
 	int err;
 	void *buf;
+	unsigned int max_bitflips;
 	loff_t addr = (loff_t)pnum * ubi->peb_size + offset;
 
 	if (!ubi->dbg->chk_io)
@@ -1421,7 +1424,7 @@ int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len)
 		return 0;
 	}
 
-	err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf);
+	err = ubi->mtd->read(ubi->mtd, addr, len, &read, buf, &max_bitflips);
 	if (err && !mtd_is_bitflip(err)) {
 		ubi_err("error %d while reading %d bytes from PEB %d:%d, "
 			"read %zd bytes", err, len, pnum, offset, read);
-- 
1.7.3.4




More information about the linux-mtd mailing list