summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-14 10:16:15 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-14 10:16:17 +0100
commit3930f38028fb8307097ced49ed034ca981b64873 (patch)
treed5e2f0be87511b9220410ffcfa4ce63938b8450e /lib
parenta40e76cebcbe8b025bafdefdc6e27b7553209ed7 (diff)
downloadbarebox-3930f38028fb8307097ced49ed034ca981b64873.tar.gz
barebox-3930f38028fb8307097ced49ed034ca981b64873.tar.xz
libmtd: rename functions from mtd_* to libmtd_*
The kernel nowadays has mtd_read/write and other functions. In barebox we also have these functions, but with a different prototype, namely they correspond to the libmtd userspace functions. Rename these functions to libmtd_* to avoid name clashes with future mtd updates. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/libmtd.c14
-rw-r--r--lib/libscan.c2
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/libmtd.c b/lib/libmtd.c
index 8c4152eb79..eecc760548 100644
--- a/lib/libmtd.c
+++ b/lib/libmtd.c
@@ -56,7 +56,7 @@ static int mtd_valid_erase_block(const struct mtd_dev_info *mtd, int eb)
return 0;
}
-int mtd_erase(const struct mtd_dev_info *mtd, int fd, int eb)
+int libmtd_erase(const struct mtd_dev_info *mtd, int fd, int eb)
{
int ret;
struct erase_info_user ei;
@@ -107,12 +107,12 @@ int mtd_torture(const struct mtd_dev_info *mtd, int fd, int eb)
buf = xmalloc(mtd->eb_size);
for (i = 0; i < patt_count; i++) {
- err = mtd_erase(mtd, fd, eb);
+ err = libmtd_erase(mtd, fd, eb);
if (err)
goto out;
/* Make sure the PEB contains only 0xFF bytes */
- err = mtd_read(mtd, fd, eb, 0, buf, mtd->eb_size);
+ err = libmtd_read(mtd, fd, eb, 0, buf, mtd->eb_size);
if (err)
goto out;
@@ -125,12 +125,12 @@ int mtd_torture(const struct mtd_dev_info *mtd, int fd, int eb)
/* Write a pattern and check it */
memset(buf, patterns[i], mtd->eb_size);
- err = mtd_write(mtd, fd, eb, 0, buf, mtd->eb_size);
+ err = libmtd_write(mtd, fd, eb, 0, buf, mtd->eb_size);
if (err)
goto out;
memset(buf, ~patterns[i], mtd->eb_size);
- err = mtd_read(mtd, fd, eb, 0, buf, mtd->eb_size);
+ err = libmtd_read(mtd, fd, eb, 0, buf, mtd->eb_size);
if (err)
goto out;
@@ -191,7 +191,7 @@ int mtd_mark_bad(const struct mtd_dev_info *mtd, int fd, int eb)
return 0;
}
-int mtd_read(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
+int libmtd_read(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
void *buf, int len)
{
int ret, rd = 0;
@@ -225,7 +225,7 @@ int mtd_read(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
return 0;
}
-int mtd_write(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
+int libmtd_write(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
void *buf, int len)
{
int ret;
diff --git a/lib/libscan.c b/lib/libscan.c
index af55269ec4..c59acfa610 100644
--- a/lib/libscan.c
+++ b/lib/libscan.c
@@ -90,7 +90,7 @@ int libscan_ubi_scan(struct mtd_dev_info *mtd, int fd, struct ubi_scan_info **in
continue;
}
- ret = mtd_read(mtd, fd, eb, 0, &ech, sizeof(struct ubi_ec_hdr));
+ ret = libmtd_read(mtd, fd, eb, 0, &ech, sizeof(struct ubi_ec_hdr));
if (ret < 0)
goto out_ec;