[PATCH 23/23] driver: remove map_base

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Jul 29 23:17:11 EDT 2011


as now all the drivers and board have been switch to resource when can drop
map_base and size from device_d

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 drivers/base/driver.c |   20 --------------------
 include/driver.h      |    6 ------
 2 files changed, 0 insertions(+), 26 deletions(-)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 4ceb346..84f9c81 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -103,26 +103,6 @@ int register_device(struct device_d *new_device)
 {
 	struct driver_d *drv;
 
-	/* if no map_base available use the first resource if available
-	 * so we do not need to duplicate it
-	 * Temporary fixup until we get rid of map_base and size
-	 */
-	if (new_device->map_base) {
-		if (new_device->resource) {
-			dev_err(new_device, "map_base and resource specifed\n");
-			return -EIO;
-		}
-		dev_warn(new_device, "uses map_base. Please convert to use resources\n");
-		new_device->resource = xzalloc(sizeof(struct resource));
-		new_device->resource[0].start = new_device->map_base;
-		new_device->resource[0].size = new_device->size;
-		new_device->resource[0].flags = IORESOURCE_MEM;
-		new_device->num_resources = 1;
-	} else if (new_device->resource) {
-		new_device->map_base = new_device->resource[0].start;
-		new_device->size = new_device->resource[0].size;
-	}
-
 	if (new_device->id < 0) {
 		new_device->id = get_free_deviceid(new_device->name);
 	} else {
diff --git a/include/driver.h b/include/driver.h
index baf8d88..b011f98 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -71,12 +71,6 @@ struct device_d {
 	 * something like eth0 or nor0. */
 	int id;
 
-	resource_size_t size;
-
-	/*! For devices which are directly mapped into memory, i.e. NOR
-	 * Flash or SDRAM. */
-	resource_size_t map_base;
-
 	struct resource *resource;
 	int num_resources;
 
-- 
1.7.5.4




More information about the barebox mailing list