Commit fcbb6af1 authored by Boris Brezillon's avatar Boris Brezillon Committed by Richard Weinberger

UBI: fastmap: use ubi_io_{read, write}_data() instead of ubi_io_{read, write}()

ubi_io_{read,write}_data() are wrappers around ubi_io_{read/write}() that
are used to read/write eraseblock payload data, which is exactly what
fastmap does when calling ubi_io_{read,write}().
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent f2fb1346
...@@ -878,7 +878,7 @@ int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai, ...@@ -878,7 +878,7 @@ int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai,
goto out; goto out;
} }
ret = ubi_io_read(ubi, fmsb, fm_anchor, ubi->leb_start, sizeof(*fmsb)); ret = ubi_io_read_data(ubi, fmsb, fm_anchor, 0, sizeof(*fmsb));
if (ret && ret != UBI_IO_BITFLIPS) if (ret && ret != UBI_IO_BITFLIPS)
goto free_fm_sb; goto free_fm_sb;
else if (ret == UBI_IO_BITFLIPS) else if (ret == UBI_IO_BITFLIPS)
...@@ -996,8 +996,8 @@ int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai, ...@@ -996,8 +996,8 @@ int ubi_scan_fastmap(struct ubi_device *ubi, struct ubi_attach_info *ai,
if (sqnum < be64_to_cpu(vh->sqnum)) if (sqnum < be64_to_cpu(vh->sqnum))
sqnum = be64_to_cpu(vh->sqnum); sqnum = be64_to_cpu(vh->sqnum);
ret = ubi_io_read(ubi, ubi->fm_buf + (ubi->leb_size * i), pnum, ret = ubi_io_read_data(ubi, ubi->fm_buf + (ubi->leb_size * i),
ubi->leb_start, ubi->leb_size); pnum, 0, ubi->leb_size);
if (ret && ret != UBI_IO_BITFLIPS) { if (ret && ret != UBI_IO_BITFLIPS) {
ubi_err(ubi, "unable to read fastmap block# %i (PEB: %i, " ubi_err(ubi, "unable to read fastmap block# %i (PEB: %i, "
"err: %i)", i, pnum, ret); "err: %i)", i, pnum, ret);
...@@ -1311,8 +1311,8 @@ static int ubi_write_fastmap(struct ubi_device *ubi, ...@@ -1311,8 +1311,8 @@ static int ubi_write_fastmap(struct ubi_device *ubi,
} }
for (i = 0; i < new_fm->used_blocks; i++) { for (i = 0; i < new_fm->used_blocks; i++) {
ret = ubi_io_write(ubi, fm_raw + (i * ubi->leb_size), ret = ubi_io_write_data(ubi, fm_raw + (i * ubi->leb_size),
new_fm->e[i]->pnum, ubi->leb_start, ubi->leb_size); new_fm->e[i]->pnum, 0, ubi->leb_size);
if (ret) { if (ret) {
ubi_err(ubi, "unable to write fastmap to PEB %i!", ubi_err(ubi, "unable to write fastmap to PEB %i!",
new_fm->e[i]->pnum); new_fm->e[i]->pnum);
......
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