summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-04-04 10:06:22 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-04-04 10:06:22 +0200
commit149e9d8121a1bf1ea1477e0eabfee1e1bfb2697f (patch)
tree2f3bb4653125c249a21c43433f9be437fe08f840 /lib
parent245bc10ca5fbd1064445281a13d51481253f1010 (diff)
parent3676454f5cb571fe1370d3d8f9b67704c08cb9b3 (diff)
downloadbarebox-149e9d8121a1bf1ea1477e0eabfee1e1bfb2697f.tar.gz
barebox-149e9d8121a1bf1ea1477e0eabfee1e1bfb2697f.tar.xz
Merge branch 'for-next/mtd'
Diffstat (limited to 'lib')
-rw-r--r--lib/libmtd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libmtd.c b/lib/libmtd.c
index 1606b872fd..56672bd951 100644
--- a/lib/libmtd.c
+++ b/lib/libmtd.c
@@ -195,7 +195,7 @@ int libmtd_read(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
void *buf, int len)
{
int ret, rd = 0;
- off_t seek;
+ loff_t seek;
ret = mtd_valid_erase_block(mtd, eb);
if (ret)
@@ -209,7 +209,7 @@ int libmtd_read(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
}
/* Seek to the beginning of the eraseblock */
- seek = (off_t)eb * mtd->eb_size + offs;
+ seek = (loff_t)eb * mtd->eb_size + offs;
if (lseek(fd, seek, SEEK_SET) != seek)
return sys_errmsg("cannot seek %s to offset %llu",
mtd->node, (unsigned long long)seek);
@@ -229,7 +229,7 @@ int libmtd_write(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
void *buf, int len)
{
int ret;
- off_t seek;
+ loff_t seek;
ret = mtd_valid_erase_block(mtd, eb);
if (ret)
@@ -255,7 +255,7 @@ int libmtd_write(const struct mtd_dev_info *mtd, int fd, int eb, int offs,
}
/* Seek to the beginning of the eraseblock */
- seek = (off_t)eb * mtd->eb_size + offs;
+ seek = (loff_t)eb * mtd->eb_size + offs;
if (lseek(fd, seek, SEEK_SET) != seek)
return sys_errmsg("cannot seek %s to offset %llu",
mtd->node, (unsigned long long)seek);
@@ -326,7 +326,7 @@ int mtd_get_dev_info(const char *node, struct mtd_dev_info *mtd)
goto out_close;
}
- mtd->eb_cnt = ui.size / ui.erasesize;
+ mtd->eb_cnt = mtd_user_div_by_eb(ui.size, &ui);
switch(mtd->type) {
case MTD_ABSENT: