[PATCH 04/12] Do not use iomem space for dev_get_mem_region

Sascha Hauer s.hauer at pengutronix.de
Mon Jun 25 13:38:22 EDT 2012


It is mostly used for mmapping sdram which is no iomem.

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

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 547d684..cb876fa 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -241,15 +241,15 @@ static struct resource *dev_get_resource(struct device_d *dev, int num)
 	return NULL;
 }
 
-void __iomem *dev_get_mem_region(struct device_d *dev, int num)
+void *dev_get_mem_region(struct device_d *dev, int num)
 {
 	struct resource *res;
 
 	res = dev_get_resource(dev, num);
 	if (!res)
-		return res;
+		return NULL;
 
-	return (void __force __iomem *)res->start;
+	return (void __force *)res->start;
 }
 EXPORT_SYMBOL(dev_get_mem_region);
 
diff --git a/include/driver.h b/include/driver.h
index 09dd1e4..470ae2d 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -183,7 +183,7 @@ static inline const char *dev_name(const struct device_d *dev)
 /*
  * get register base 'num' for a device
  */
-void __iomem *dev_get_mem_region(struct device_d *dev, int num);
+void *dev_get_mem_region(struct device_d *dev, int num);
 
 /*
  * exlusively request register base 'num' for a device
-- 
1.7.10




More information about the barebox mailing list