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 08/12] nomadik: switch to add_generic_device
Date: Sun, 24 Jul 2011 16:49:05 +0200	[thread overview]
Message-ID: <1311518949-6990-8-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>
---
 arch/arm/boards/nhk8815/setup.c |   18 +--------------
 arch/arm/mach-nomadik/8815.c    |   42 +++++++-------------------------------
 2 files changed, 10 insertions(+), 50 deletions(-)

diff --git a/arch/arm/boards/nhk8815/setup.c b/arch/arm/boards/nhk8815/setup.c
index b7fa50a..da6be93 100644
--- a/arch/arm/boards/nhk8815/setup.c
+++ b/arch/arm/boards/nhk8815/setup.c
@@ -33,21 +33,6 @@
 #include <mach/nand.h>
 #include <mach/fsmc.h>
 
-static struct resource nhk8815_network_resources[] = {
-	[0] = {
-		.start	= 0x34000300,
-		.size	= 16,
-		.flags	= IORESOURCE_MEM,
-	},
-};
-
-static struct device_d nhk8815_network_dev = {
-	.id = -1,
-	.name = "smc91c111",
-	.num_resources	= ARRAY_SIZE(nhk8815_network_resources),
-	.resource	= nhk8815_network_resources,
-};
-
 static int nhk8815_nand_init(void)
 {
 	/* FSMC setup for nand chip select (8-bit nand in 8815NHK) */
@@ -104,7 +89,8 @@ static int nhk8815_devices_init(void)
 	writel(0x0000305b, FSMC_BCR(1));
 	writel(0x00033f33, FSMC_BTR(1));
 
-	register_device(&nhk8815_network_dev);
+	add_generic_device("smc91c111", -1, NULL, 0x34000300, 16,
+			   IORESOURCE_MEM, NULL);
 
 	register_device(&nhk8815_nand_device);
 
diff --git a/arch/arm/mach-nomadik/8815.c b/arch/arm/mach-nomadik/8815.c
index 9df32a3..f2b8fd0 100644
--- a/arch/arm/mach-nomadik/8815.c
+++ b/arch/arm/mach-nomadik/8815.c
@@ -40,46 +40,20 @@ void st8815_add_device_sdram(u32 size)
 	armlinux_add_dram(sdram_dev);
 }
 
-static struct resource uart0_serial_resources[] = {
-	[0] = {
-		.start	= NOMADIK_UART0_BASE,
-		.size	= 4096,
-		.flags	= IORESOURCE_MEM,
-	},
-};
-
-static struct device_d uart0_serial_device = {
-	.id = 0,
-	.name = "uart-pl011",
-	.num_resources	= ARRAY_SIZE(uart0_serial_resources),
-	.resource	= uart0_serial_resources,
-};
-
-static struct resource uart1_serial_resources[] = {
-	[0] = {
-		.start	= NOMADIK_UART1_BASE,
-		.size	= 4096,
-		.flags	= IORESOURCE_MEM,
-	},
-};
-
-static struct device_d uart1_serial_device = {
-	.id = 1,
-	.name = "uart-pl011",
-	.num_resources	= ARRAY_SIZE(uart1_serial_resources),
-	.resource	= uart1_serial_resources,
-};
-
 void st8815_register_uart(unsigned id)
 {
+	resource_size_t start;
+	struct device_d *dev;
+
 	switch (id) {
 	case 0:
-		nmdk_clk_create(&st8815_clk_48, dev_name(&uart0_serial_device));
-		register_device(&uart0_serial_device);
+		start = NOMADIK_UART1_BASE;
 		break;
 	case 1:
-		nmdk_clk_create(&st8815_clk_48, dev_name(&uart1_serial_device));
-		register_device(&uart1_serial_device);
+		start = NOMADIK_UART1_BASE;
 		break;
 	}
+	dev = add_generic_device("uart-pl011", id, NULL, start, 4096,
+			   IORESOURCE_MEM, NULL);
+	nmdk_clk_create(&st8815_clk_48, dev_name(dev));
 }
-- 
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 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
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 ` [PATCH 12/12] nand: " Jean-Christophe PLAGNIOL-VILLARD
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-8-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