summaryrefslogtreecommitdiff
path: root/ubi-utils/src/libscan.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-04-18 16:01:40 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-04-18 16:05:50 +0300
commit194b2a55f626b94323b377d75edb295f536359c5 (patch)
tree91e771457a49ca06775f2e1afcbb6756f8cfc5ce /ubi-utils/src/libscan.c
parenta2ce5f7a0f5abf0077e057c476440d10e5e5ef45 (diff)
libmtd: amend interface
Remove the fd field from the mtd information data structure, because libmtd does not really know the device node file name, and serves only as a place to save the descriptor. The callers should find a better place. This patch improves code readability and prepares for further changes. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'ubi-utils/src/libscan.c')
-rw-r--r--ubi-utils/src/libscan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ubi-utils/src/libscan.c b/ubi-utils/src/libscan.c
index dc1f083..4d64bca 100644
--- a/ubi-utils/src/libscan.c
+++ b/ubi-utils/src/libscan.c
@@ -48,7 +48,7 @@ static int all_ff(const void *buf, int len)
return 1;
}
-int ubi_scan(struct mtd_info *mtd, struct ubi_scan_info **info, int verbose)
+int ubi_scan(struct mtd_info *mtd, int fd, struct ubi_scan_info **info, int verbose)
{
int eb, v = (verbose == 2), pr = (verbose == 1);
struct ubi_scan_info *si;
@@ -85,7 +85,7 @@ int ubi_scan(struct mtd_info *mtd, struct ubi_scan_info **info, int verbose)
fflush(stdout);
}
- ret = mtd_is_bad(mtd, eb);
+ ret = mtd_is_bad(mtd, fd, eb);
if (ret == -1)
goto out_ec;
if (ret) {
@@ -96,7 +96,7 @@ int ubi_scan(struct mtd_info *mtd, struct ubi_scan_info **info, int verbose)
continue;
}
- ret = mtd_read(mtd, eb, 0, &hdr, sizeof(struct ubi_ec_hdr));;
+ ret = mtd_read(mtd, fd, eb, 0, &hdr, sizeof(struct ubi_ec_hdr));
if (ret < 0)
goto out_ec;