[PATCH 04/19] generic memmap: use resources

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


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

diff --git a/lib/driver.c b/lib/driver.c
index 50f065a..cc900e2 100644
--- a/lib/driver.c
+++ b/lib/driver.c
@@ -262,7 +262,7 @@ int generic_memmap_ro(struct cdev *cdev, void **map, int flags)
 
 	if (flags & PROT_WRITE)
 		return -EACCES;
-	*map = (void *)cdev->dev->map_base;
+	*map = dev_get_mem_region(cdev->dev, 0);
 	return 0;
 }
 
@@ -271,7 +271,7 @@ int generic_memmap_rw(struct cdev *cdev, void **map, int flags)
 	if (!cdev->dev)
 		return -EINVAL;
 
-	*map = (void *)cdev->dev->map_base;
+	*map = dev_get_mem_region(cdev->dev, 0);
 	return 0;
 }
 
-- 
1.7.5.4




More information about the barebox mailing list