[PATCH 2/2] nomadik_nand: switch to named resource

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Wed Oct 17 09:05:15 EDT 2012


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/boards/nhk8815/setup.c |    3 +++
 drivers/mtd/nand/nomadik_nand.c |    6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/nhk8815/setup.c b/arch/arm/boards/nhk8815/setup.c
index 7f93ecb..0c85b25 100644
--- a/arch/arm/boards/nhk8815/setup.c
+++ b/arch/arm/boards/nhk8815/setup.c
@@ -50,14 +50,17 @@ static struct nomadik_nand_platform_data nhk8815_nand_data = {
 
 static struct resource nhk8815_nand_resources[] = {
 	{
+		.name	= "nand_addr",
 		.start	= NAND_IO_ADDR,
 		.end	= NAND_IO_ADDR + 0xfff,
 		.flags	= IORESOURCE_MEM,
 	}, {
+		.name	= "nand_cmd",
 		.start	= NAND_IO_CMD,
 		.end	= NAND_IO_CMD + 0xfff,
 		.flags	= IORESOURCE_MEM,
 	}, {
+		.name	= "nand_data",
 		.start	= NAND_IO_DATA,
 		.end	= NAND_IO_DATA + 0xfff,
 		.flags	= IORESOURCE_MEM,
diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c
index 6fc9398..b19d6c6 100644
--- a/drivers/mtd/nand/nomadik_nand.c
+++ b/drivers/mtd/nand/nomadik_nand.c
@@ -189,8 +189,8 @@ static int nomadik_nand_probe(struct device_d *dev)
 		goto err;
 	}
 
-	host->cmd_va = dev_request_mem_region(dev, 1);
-	host->addr_va = dev_request_mem_region(dev, 0);
+	host->cmd_va = dev_request_mem_region_by_name(dev, "nand_cmd");
+	host->addr_va = dev_request_mem_region_by_name(dev, "nand_addr");
 
 	/* Link all private pointers */
 	mtd = &host->mtd;
@@ -198,7 +198,7 @@ static int nomadik_nand_probe(struct device_d *dev)
 	mtd->priv = nand;
 	nand->priv = host;
 
-	nand->IO_ADDR_W = nand->IO_ADDR_R = dev_request_mem_region(dev, 2);
+	nand->IO_ADDR_W = nand->IO_ADDR_R = dev_request_mem_region_by_name(dev, "nand_data");
 	nand->cmd_ctrl = nomadik_cmd_ctrl;
 
 	nand->ecc.mode = NAND_ECC_HW;
-- 
1.7.10.4




More information about the barebox mailing list