summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/core.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-02-08 14:20:20 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-02-09 09:30:30 +0100
commite9ff55fe2dd628de21308b80d464e044f8213226 (patch)
tree51c9b8cea3e87f4de201360cbecbc79f5fc9bb17 /drivers/mtd/core.c
parent1e009bf2667c7f304ea181974e3e22cb7b6a025b (diff)
downloadbarebox-e9ff55fe2dd628de21308b80d464e044f8213226.tar.gz
barebox-e9ff55fe2dd628de21308b80d464e044f8213226.tar.xz
mtd: Fix mtd_op_read for devices >4GiB
The mtd read file operation has a unnecessary conversion to unsigned long in the read offset. Remove it to make it work with chips >4GiB Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/core.c')
-rw-r--r--drivers/mtd/core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 586b4a0ae3..3251bbcffd 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -67,14 +67,13 @@ int mtd_all_ff(const void *buf, unsigned int len)
}
static ssize_t mtd_op_read(struct cdev *cdev, void* buf, size_t count,
- loff_t _offset, ulong flags)
+ loff_t offset, ulong flags)
{
struct mtd_info *mtd = cdev->priv;
size_t retlen;
int ret;
- unsigned long offset = _offset;
- dev_dbg(cdev->dev, "read ofs: 0x%08lx count: 0x%08zx\n",
+ dev_dbg(cdev->dev, "read ofs: 0x%08llx count: 0x%08zx\n",
offset, count);
ret = mtd_read(mtd, offset, count, &retlen, buf);