From 194b2a55f626b94323b377d75edb295f536359c5 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Sat, 18 Apr 2009 16:01:40 +0300 Subject: 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 --- ubi-utils/src/libscan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ubi-utils/src/libscan.c') 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; -- cgit v1.2.3