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 12/12] nand: convert to struct resource
Date: Sun, 24 Jul 2011 16:49:09 +0200	[thread overview]
Message-ID: <1311518949-6990-12-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20110724144441.GA10295@game.jcrosoft.org>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/mtd/nand/nand_omap_gpmc.c |   10 +++++-----
 drivers/mtd/nand/nand_s3c2410.c   |    4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index 4a2d561..083aa57 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -14,8 +14,8 @@
  * static struct device_d my_nand_device = {
  *	.name = "gpmc_nand",
  *	.id = some identifier you need to show.. e.g. "gpmc_nand0"
- *	.map_base = GPMC base address
- *	.size = GPMC address map size.
+ *	.resource[0].start = GPMC base address
+ *	.resource[0].size = GPMC address map size.
  *	.platform_data = platform data - required - explained below
  * };
  * platform data required:
@@ -97,7 +97,7 @@ struct gpmc_nand_info {
 	void *gpmc_command;
 	void *gpmc_address;
 	void *gpmc_data;
-	unsigned long gpmc_base;
+	void __iomem *gpmc_base;
 	unsigned char wait_mon_mask;
 	uint64_t timeout;
 	unsigned inuse:1;
@@ -672,7 +672,7 @@ static int gpmc_nand_probe(struct device_d *pdev)
 	struct gpmc_nand_platform_data *pdata;
 	struct nand_chip *nand;
 	struct mtd_info *minfo;
-	unsigned long cs_base;
+	void __iomem *cs_base;
 	int err;
 	struct nand_ecclayout *layout, *lsp, *llp;
 
@@ -703,7 +703,7 @@ static int gpmc_nand_probe(struct device_d *pdev)
 	}
 	/* Setup register specific data */
 	oinfo->gpmc_cs = pdata->cs;
-	oinfo->gpmc_base = pdev->map_base;
+	oinfo->gpmc_base = dev_request_mem_region(pdev, 0);
 	cs_base = oinfo->gpmc_base + GPMC_CONFIG1_0 +
 		(pdata->cs * GPMC_CONFIG_CS_SIZE);
 	oinfo->gpmc_command = (void *)(cs_base + GPMC_CS_NAND_COMMAND);
diff --git a/drivers/mtd/nand/nand_s3c2410.c b/drivers/mtd/nand/nand_s3c2410.c
index 88e89cd..0ce20d4 100644
--- a/drivers/mtd/nand/nand_s3c2410.c
+++ b/drivers/mtd/nand/nand_s3c2410.c
@@ -422,7 +422,7 @@ static int s3c24x0_nand_probe(struct device_d *dev)
 		return -ENOMEM;
 
 	host->dev = dev;
-	host->base = IOMEM(dev->map_base);
+	host->base = dev_request_mem_region(dev, 0);
 
 	/* structures must be linked */
 	chip = &host->nand;
@@ -435,7 +435,7 @@ static int s3c24x0_nand_probe(struct device_d *dev)
 	chip->chip_delay = 50;
 	chip->priv = host;
 
-	chip->IO_ADDR_R = chip->IO_ADDR_W = IOMEM(dev->map_base + NFDATA);
+	chip->IO_ADDR_R = chip->IO_ADDR_W = host->base + NFDATA;
 
 #ifdef CONFIG_CPU_S3C2440
 	chip->read_buf = s3c2440_nand_read_buf;
-- 
1.7.5.4


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

  parent reply	other threads:[~2011-07-24 15:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-24 14:44 [PATCH 0/12] more device rework Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:48 ` [PATCH 01/12] drivers/bus: move to drivers/base Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:48 ` [PATCH 02/12] drivers: move resource generic management to driver/base/resource.c Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` [PATCH 03/12 v2] resource: introduce add_generic_device to register simple device Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` [PATCH 04/12 v2] at91: switch to add_generic_device Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` [PATCH 05/12 v2] imx/devices: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` [PATCH 06/12] resource: introduce add_cfi_device to register simple cfi device Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` [PATCH 07/12] versatile: switch to add_generic_device Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` [PATCH 08/12] nomadik: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` [PATCH 09/12] mci: switch to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` [PATCH 10/12] ata/bios: convert to struct resource Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` [PATCH 11/12] i2c: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-24 14:49 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-07-25  9:32 ` [PATCH 0/12] more device rework Sascha Hauer
2011-07-25 13:39   ` Jean-Christophe PLAGNIOL-VILLARD
2011-07-26  6:56     ` 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=1311518949-6990-12-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