summaryrefslogtreecommitdiff
path: root/ubi-utils/libubi.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-23 11:37:05 +0300
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-23 11:37:05 +0300
commit257ad252e70a7b65f11f7f006416a76e4498f3d2 (patch)
treece2396403f1f19d4feaa3ef0c33d57bb2cfde365 /ubi-utils/libubi.c
parent24c95043a1fd464388563f31b5f40831f74e04b3 (diff)
libubi: kill ubi_attach_mtd
The 'ubi_attach_mtd()' is not used and it is redundant now. 'ubi_attach()' function may be used instead. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'ubi-utils/libubi.c')
-rw-r--r--ubi-utils/libubi.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/ubi-utils/libubi.c b/ubi-utils/libubi.c
index dec72c7..14719f1 100644
--- a/ubi-utils/libubi.c
+++ b/ubi-utils/libubi.c
@@ -707,26 +707,6 @@ static int do_attach(const char *node, const struct ubi_attach_req *r)
return ret;
}
-int ubi_attach_mtd(libubi_t desc, const char *node,
- struct ubi_attach_request *req)
-{
- struct ubi_attach_req r;
- int ret;
-
- (void)desc;
-
- memset(&r, 0, sizeof(struct ubi_attach_req));
- r.ubi_num = req->dev_num;
- r.mtd_num = req->mtd_num;
- r.vid_hdr_offset = req->vid_hdr_offset;
-
- ret = do_attach(node, &r);
- if (ret == 0)
- req->dev_num = r.ubi_num;
-
- return ret;
-}
-
#ifndef MTD_CHAR_MAJOR
/*
* This is taken from kernel <linux/mtd/mtd.h> and is unlikely to change anytime
@@ -770,6 +750,11 @@ static int mtd_node_to_num(const char *mtd_dev_node)
int ubi_attach(libubi_t desc, const char *node, struct ubi_attach_request *req)
{
+ struct ubi_attach_req r;
+ int ret;
+
+ (void)desc;
+
if (req->mtd_dev_node) {
/*
* User has passed path to device node. Lets find out MTD
@@ -779,7 +764,17 @@ int ubi_attach(libubi_t desc, const char *node, struct ubi_attach_request *req)
if (req->mtd_num == -1)
return -1;
}
- return ubi_attach_mtd(desc, node, req);
+
+ memset(&r, 0, sizeof(struct ubi_attach_req));
+ r.ubi_num = req->dev_num;
+ r.mtd_num = req->mtd_num;
+ r.vid_hdr_offset = req->vid_hdr_offset;
+
+ ret = do_attach(node, &r);
+ if (ret == 0)
+ req->dev_num = r.ubi_num;
+
+ return ret;
}
int ubi_detach_mtd(libubi_t desc, const char *node, int mtd_num)