mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] nomadik_nand: switch to named resource
Date: Wed, 17 Oct 2012 15:05:15 +0200	[thread overview]
Message-ID: <1350479115-29192-2-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1350479115-29192-1-git-send-email-plagnioj@jcrosoft.com>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-10-17 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 13:03 [PATCH 0/2] allow to use named resources Jean-Christophe PLAGNIOL-VILLARD
2012-10-17 13:05 ` [PATCH 1/2] driver: add support for requesting resource by name Jean-Christophe PLAGNIOL-VILLARD
2012-10-17 13:05   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-10-23  8:44 ` [PATCH 0/2] allow to use named resources Sascha Hauer
2012-10-23 10:22   ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-27 12:38 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1350479115-29192-2-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox