[PATCH 05/19] mem_read/write: use resources

Sascha Hauer s.hauer at pengutronix.de
Tue Jul 19 04:39:49 EDT 2011


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 fs/fs.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/fs.c b/fs/fs.c
index e71d5a2..bcc6ff4 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1048,8 +1048,7 @@ ssize_t mem_read(struct cdev *cdev, void *buf, size_t count, ulong offset, ulong
 	dev = cdev->dev;
 
 	size = min((ulong)count, dev->size - offset);
-	debug("mem_read: dev->map_base: %p size: %d offset: %d\n",dev->map_base, size, offset);
-	memcpy_sz(buf, (void *)(dev->map_base + offset), size, flags & O_RWSIZE_MASK);
+	memcpy_sz(buf, dev_get_mem_region(dev, 0) + offset, size, flags & O_RWSIZE_MASK);
 	return size;
 }
 EXPORT_SYMBOL(mem_read);
@@ -1064,7 +1063,7 @@ ssize_t mem_write(struct cdev *cdev, const void *buf, size_t count, ulong offset
 	dev = cdev->dev;
 
 	size = min((ulong)count, dev->size - offset);
-	memcpy_sz((void *)(dev->map_base + offset), buf, size, flags & O_RWSIZE_MASK);
+	memcpy_sz(dev_get_mem_region(dev, 0) + offset, buf, size, flags & O_RWSIZE_MASK);
 	return size;
 }
 EXPORT_SYMBOL(mem_write);
-- 
1.7.5.4




More information about the barebox mailing list