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 6/7] omap: switch to add_generic_device
Date: Fri, 29 Jul 2011 17:59:48 +0200	[thread overview]
Message-ID: <1311955207-22372-11-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20110729155356.GF25658@game.jcrosoft.org>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/omap/board-beagle.c    |   30 ++++++------------------------
 arch/arm/boards/omap/board-sdp343x.c   |    1 -
 arch/arm/mach-omap/devices-gpmc-nand.c |   13 +++----------
 3 files changed, 9 insertions(+), 35 deletions(-)

diff --git a/arch/arm/boards/omap/board-beagle.c b/arch/arm/boards/omap/board-beagle.c
index adf0b94..8f868ad 100644
--- a/arch/arm/boards/omap/board-beagle.c
+++ b/arch/arm/boards/omap/board-beagle.c
@@ -242,14 +242,6 @@ static struct NS16550_plat serial_plat = {
 	.reg_write = omap_uart_write,
 };
 
-static struct device_d beagle_serial_device = {
-	.id = -1,
-	.name = "serial_ns16550",
-	.map_base = OMAP_UART3_BASE,
-	.size = 1024,
-	.platform_data = (void *)&serial_plat,
-};
-
 /**
  * @brief UART serial port initialization - remember to enable COM clocks in
  * arch
@@ -259,7 +251,8 @@ static struct device_d beagle_serial_device = {
 static int beagle_console_init(void)
 {
 	/* Register the serial port */
-	return register_device(&beagle_serial_device);
+	return !!add_generic_device("serial_ns16550", -1, NULL, OMAP_UART3_BASE, 1024,
+			   IORESOURCE_MEM, &serial_plat);
 }
 console_initcall(beagle_console_init);
 #endif /* CONFIG_DRIVER_SERIAL_NS16550 */
@@ -280,25 +273,12 @@ static struct ehci_platform_data ehci_pdata = {
 };
 #endif /* CONFIG_USB_EHCI_OMAP */
 
-static struct device_d i2c_dev = {
-	.id		= -1,
-	.name		= "i2c-omap",
-	.map_base	= OMAP_I2C1_BASE,
-};
-
 static struct i2c_board_info i2c_devices[] = {
 	{
 		I2C_BOARD_INFO("twl4030", 0x48),
 	},
 };
 
-static struct device_d hsmmc_dev = {
-	.id = -1,
-	.name = "omap-hsmmc",
-	.map_base = 0x4809C000,
-	.size = SZ_4K,
-};
-
 static int beagle_devices_init(void)
 {
 	struct device_d *sdram_dev;
@@ -310,7 +290,8 @@ static int beagle_devices_init(void)
 	armlinux_add_dram(sdram_dev);
 
 	i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
-	register_device(&i2c_dev);
+	add_generic_device("i2c-omap", -1, NULL, 0x4809C000, SZ_4K,
+			   IORESOURCE_MEM, NULL);
 
 #ifdef CONFIG_USB_EHCI_OMAP
 	if (ehci_omap_init(&omap_ehci_pdata) >= 0)
@@ -323,7 +304,8 @@ static int beagle_devices_init(void)
 #endif
 	gpmc_generic_nand_devices_init(0, 16, OMAP_ECC_HAMMING_CODE_HW_ROMCODE);
 
-	register_device(&hsmmc_dev);
+	add_generic_device("omap-hsmmc", -1, NULL, OMAP_I2C1_BASE, 0,
+			   IORESOURCE_MEM, NULL);
 
 	armlinux_set_bootparams((void *)0x80000100);
 	armlinux_set_architecture(MACH_TYPE_OMAP3_BEAGLE);
diff --git a/arch/arm/boards/omap/board-sdp343x.c b/arch/arm/boards/omap/board-sdp343x.c
index 04aa302..360766a 100644
--- a/arch/arm/boards/omap/board-sdp343x.c
+++ b/arch/arm/boards/omap/board-sdp343x.c
@@ -647,7 +647,6 @@ static int sdp3430_flash_init(void)
 static int sdp3430_devices_init(void)
 {
 	struct device_d *sdram_dev;
-	int ret;
 
 	sdram_dev = add_mem_device("ram0", 0x80000000, 128 * 1024 * 1024,
 				   IORESOURCE_MEM_WRITEABLE);
diff --git a/arch/arm/mach-omap/devices-gpmc-nand.c b/arch/arm/mach-omap/devices-gpmc-nand.c
index c2a2b0d..bf409a7 100644
--- a/arch/arm/mach-omap/devices-gpmc-nand.c
+++ b/arch/arm/mach-omap/devices-gpmc-nand.c
@@ -70,15 +70,6 @@ static struct gpmc_nand_platform_data nand_plat = {
 	.priv = (void *)&nand_cfg,
 };
 
-/** NAND device definition */
-static struct device_d gpmc_generic_nand_nand_device = {
-	.id = -1,
-	.name = "gpmc_nand",
-	.map_base = OMAP_GPMC_BASE,
-	.size = 1024 * 4,	/* GPMC size */
-	.platform_data = (void *)&nand_plat,
-};
-
 /**
  * @brief gpmc_generic_nand_devices_init - init generic nand device
  *
@@ -99,5 +90,7 @@ int gpmc_generic_nand_devices_init(int cs, int width,
 
 	/* Configure GPMC CS before register */
 	gpmc_cs_config(nand_plat.cs, &nand_cfg);
-	return register_device(&gpmc_generic_nand_nand_device);
+
+	return !!add_generic_device("gpmc_nand", -1, NULL, OMAP_GPMC_BASE, 1024 * 4,
+			   IORESOURCE_MEM, &nand_plat);
 }
-- 
1.7.5.4


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

  parent reply	other threads:[~2011-07-29 16:17 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29 15:53 [PULL] final switch to resoruce Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 01/23] eukrea_cpuimx35: fix warning: 'usbotg_dev' defined but not used Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 1/7] generic_memmap_ro/rw: switch to resource Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 2/7] devinfo: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 02/23] generic_memmap_ro/rw: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 03/23] devinfo: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 3/7] dm9000: replace DM9000_WIDTH_8/16/32 by IORESOURCE_MEM_8/16/32BIT Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 4/7] dm9000: introduce add_dm9000_device to register dm9000 device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 04/23] dm9000: replace DM9000_WIDTH_8/16/32 by IORESOURCE_MEM_8/16/32BIT Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 05/23] dm9000: introduce add_dm9000_device to register dm9000 device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 5/7] resource: introduce add_usb_ehci_device to register echi device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-07-29 15:59 ` [PATCH 06/23] " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 7/7] fb: switch to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 07/23] omap: switch to add_generic_device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 08/23] fb: switch to "struct resource" Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 09/23] cfi_flash: convert missing map_base Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 10/23] fsl_udc: switch to resource Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 11/23] pcm030: switch to resources Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 12/23] ipe337: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-29 15:59 ` [PATCH 13/23] s3c/boards: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 14/23] ns16550: if not specific f_caps defined use default stdin, stdout, stderr Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 15/23] edb93xx: switch to resource Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 16/23] netx: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 17/23] fs: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 18/23] ata: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 19/23] sandbox: " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 20/23] imx: switch remaing board " Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 21/23] mci-core: switch " Jean-Christophe PLAGNIOL-VILLARD
2011-08-01  7:32   ` Sascha Hauer
2011-08-01  7:47     ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-01  8:09       ` Sascha Hauer
2011-08-01  8:03         ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-01  8:21           ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-01  8:53           ` Sascha Hauer
2011-07-30  3:17 ` [PATCH 22/23] nios2: remove dead code in generic board Jean-Christophe PLAGNIOL-VILLARD
2011-07-30  3:17 ` [PATCH 23/23] driver: remove map_base Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 10:45 ` [PULL] final switch to resoruce Jean-Christophe PLAGNIOL-VILLARD
2011-08-01 12:11   ` Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2011-07-29  5:52 [PATCH 1/7] generic_memmap_ro/rw: switch to resource Jean-Christophe PLAGNIOL-VILLARD
2011-07-29  5:52 ` [PATCH 6/7] omap: switch to add_generic_device Jean-Christophe PLAGNIOL-VILLARD
2011-07-29  7:07   ` Franck JULLIEN
2011-07-29 13:36     ` Jean-Christophe PLAGNIOL-VILLARD

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=1311955207-22372-11-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