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 09/10] nomadik_nand: use "struct resource" instead of platform_data
Date: Mon, 18 Jul 2011 14:54:37 +0200	[thread overview]
Message-ID: <1310993678-7563-9-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1310993678-7563-1-git-send-email-plagnioj@jcrosoft.com>

drop data_va, cmd_va and addr_va in favor of resources

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/nhk8815/setup.c           |   18 +++++++++++++++---
 arch/arm/mach-nomadik/include/mach/nand.h |    3 ---
 drivers/mtd/nand/nomadik_nand.c           |    8 ++++----
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boards/nhk8815/setup.c b/arch/arm/boards/nhk8815/setup.c
index 3d08516..3b67e44 100644
--- a/arch/arm/boards/nhk8815/setup.c
+++ b/arch/arm/boards/nhk8815/setup.c
@@ -61,17 +61,29 @@ static int nhk8815_nand_init(void)
 }
 
 static struct nomadik_nand_platform_data nhk8815_nand_data = {
-	.addr_va	= NAND_IO_ADDR,
-	.cmd_va		= NAND_IO_CMD,
-	.data_va	= NAND_IO_DATA,
 	.options	= NAND_COPYBACK | NAND_CACHEPRG | NAND_NO_PADDING \
 			| NAND_NO_READRDY | NAND_NO_AUTOINCR,
 	.init		= nhk8815_nand_init,
 };
 
+static struct resource nhk8815_nand_resources[] = {
+	{
+		.start	= NAND_IO_ADDR,
+		.size	= 0xfff,
+	}, {
+		.start	= NAND_IO_CMD,
+		.size	= 0xfff,
+	}, {
+		.start	= NAND_IO_DATA,
+		.size	= 0xfff,
+	}
+};
+
 static struct device_d nhk8815_nand_device = {
 	.id		= -1,
 	.name		= "nomadik_nand",
+	.num_resources	= ARRAY_SIZE(nhk8815_nand_resources),
+	.resource	= nhk8815_nand_resources,
 	.platform_data	= &nhk8815_nand_data,
 };
 
diff --git a/arch/arm/mach-nomadik/include/mach/nand.h b/arch/arm/mach-nomadik/include/mach/nand.h
index 265fe53..544f0e0 100644
--- a/arch/arm/mach-nomadik/include/mach/nand.h
+++ b/arch/arm/mach-nomadik/include/mach/nand.h
@@ -2,9 +2,6 @@
 #define __ASM_ARCH_NAND_H
 
 struct nomadik_nand_platform_data {
-	unsigned long data_va;
-	unsigned long cmd_va;
-	unsigned long addr_va;
 	int options;
 	int (*init) (void);
 };
diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c
index 673fd88..058170f 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 = (void __iomem*)pdata->cmd_va;
-	host->addr_va = (void __iomem*)pdata->addr_va;
+	host->cmd_va = (void __iomem*)dev->resource[1].start;
+	host->addr_va = (void __iomem*)dev->resource[0].start;
 
 	/* Link all private pointers */
 	mtd = &host->mtd;
@@ -198,8 +198,8 @@ static int nomadik_nand_probe(struct device_d *dev)
 	mtd->priv = nand;
 	nand->priv = host;
 
-	nand->IO_ADDR_R = (void __iomem*)pdata->data_va;
-	nand->IO_ADDR_W = (void __iomem*)pdata->data_va;
+	nand->IO_ADDR_R = (void __iomem *)dev->resource[2].start;
+	nand->IO_ADDR_W = (void __iomem *)dev->resource[2].start;
 	nand->cmd_ctrl = nomadik_cmd_ctrl;
 
 	nand->ecc.mode = NAND_ECC_HW;
-- 
1.7.5.4


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

  parent reply	other threads:[~2011-07-18 13:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-18 12:54 [PATCH 01/10 v2] device: introduce resource structure to simplify resource declaration Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 12:54 ` [PATCH 02/10] at91: switch to all resource declaration to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 12:54 ` [PATCH 03/10] at91/serial: switch " Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 12:54 ` [PATCH 04/10] macb: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 12:54 ` [PATCH 05/10] atmel_mci: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 12:54 ` [PATCH 06/10] atmel_nand: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 12:54 ` [PATCH 07/10 v2] dm9200: use "struct resource" instead of platform_data Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 12:54 ` [PATCH 08/10] nomadik: switch to all resource declaration to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 12:54 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-07-18 12:54 ` [PATCH 10/10] amba-pl011: switch " Jean-Christophe PLAGNIOL-VILLARD
2011-07-18 20:48 ` [PATCH 01/10 v2] device: introduce resource structure to simplify resource declaration 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=1310993678-7563-9-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