* [PATCH 1/4] device: update id support to allow device without id
2011-08-15 8:46 [PATCH] parent fixups Sascha Hauer
` (7 preceding siblings ...)
2011-08-15 9:14 ` [PATCH] parent fixups Jean-Christophe PLAGNIOL-VILLARD
@ 2011-08-16 5:36 ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-18 5:26 ` Sascha Hauer
2011-08-16 5:36 ` [PATCH 2/4] add bus registration support Jean-Christophe PLAGNIOL-VILLARD
` (2 subsequent siblings)
11 siblings, 1 reply; 19+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-16 5:36 UTC (permalink / raw)
To: barebox
as in linux use -1 for this
as example on bus we may have only one device so no need to have
devname<number>
for automatic id use -2 now
udpate all the device that use -1 to -2
device that really want -1 will have to update later
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/boards/a9m2410/a9m2410.c | 6 +++---
arch/arm/boards/a9m2440/a9m2440.c | 6 +++---
arch/arm/boards/chumby_falconwing/falconwing.c | 2 +-
arch/arm/boards/edb93xx/edb93xx.c | 6 +++---
arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c | 4 ++--
arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c | 8 ++++----
arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c | 4 ++--
arch/arm/boards/freescale-mx25-3-stack/3stack.c | 2 +-
arch/arm/boards/freescale-mx35-3-stack/3stack.c | 4 ++--
arch/arm/boards/guf-neso/board.c | 2 +-
arch/arm/boards/imx21ads/imx21ads.c | 4 ++--
arch/arm/boards/imx27ads/imx27ads.c | 2 +-
arch/arm/boards/mini2440/mini2440.c | 4 ++--
arch/arm/boards/netx/netx.c | 8 ++++----
arch/arm/boards/nhk8815/setup.c | 4 ++--
arch/arm/boards/omap/board-beagle.c | 8 ++++----
arch/arm/boards/omap/board-omap3evm.c | 2 +-
arch/arm/boards/omap/board-sdp343x.c | 2 +-
arch/arm/boards/panda/board.c | 6 +++---
arch/arm/boards/pcm037/pcm037.c | 8 ++++----
arch/arm/boards/pcm038/pcm038.c | 4 ++--
arch/arm/boards/pcm043/pcm043.c | 2 +-
arch/arm/boards/pcm049/board.c | 6 +++---
arch/arm/boards/phycard-i.MX27/pca100.c | 4 ++--
arch/arm/boards/scb9328/scb9328.c | 4 ++--
arch/arm/boards/versatile/versatilepb.c | 4 ++--
arch/arm/mach-at91/at91sam9263_devices.c | 2 +-
arch/arm/mach-at91/at91sam9g45_devices.c | 2 +-
arch/arm/mach-imx/devices.c | 8 ++++----
arch/arm/mach-omap/devices-gpmc-nand.c | 2 +-
arch/blackfin/boards/ipe337/ipe337.c | 6 +++---
arch/mips/boards/dlink-dir-320/serial.c | 2 +-
arch/mips/boards/qemu-malta/serial.c | 2 +-
arch/nios2/boards/generic/generic.c | 6 +++---
arch/ppc/boards/pcm030/pcm030.c | 8 ++++----
arch/sandbox/board/hostfile.c | 2 +-
arch/x86/boards/x86_generic/generic_pc.c | 4 ++--
common/console.c | 2 +-
drivers/base/driver.c | 5 ++++-
drivers/mci/mci-core.c | 2 +-
drivers/net/miidev.c | 2 +-
include/driver.h | 2 +-
net/eth.c | 2 +-
43 files changed, 89 insertions(+), 86 deletions(-)
diff --git a/arch/arm/boards/a9m2410/a9m2410.c b/arch/arm/boards/a9m2410/a9m2410.c
index 44ac44b..0d26da9 100644
--- a/arch/arm/boards/a9m2410/a9m2410.c
+++ b/arch/arm/boards/a9m2410/a9m2410.c
@@ -131,14 +131,14 @@ static int a9m2410_devices_init(void)
writel(reg, MISCCR);
/* ----------- the devices the boot loader should work with -------- */
- add_generic_device("s3c24x0_nand", -1, NULL, S3C24X0_NAND_BASE, 0,
+ add_generic_device("s3c24x0_nand", -2, NULL, S3C24X0_NAND_BASE, 0,
IORESOURCE_MEM, &nand_info);
/*
* SMSC 91C111 network controller on the baseboard
* connected to CS line 1 and interrupt line
* GPIO3, data width is 32 bit
*/
- add_generic_device("smc91c111", -1, NULL, CS1_BASE + 0x300, 16,
+ add_generic_device("smc91c111", -2, NULL, CS1_BASE + 0x300, 16,
IORESOURCE_MEM, NULL);
#ifdef CONFIG_NAND
@@ -167,7 +167,7 @@ void __bare_init nand_boot(void)
static int a9m2410_console_init(void)
{
- add_generic_device("s3c24x0_serial", -1, NULL, UART1_BASE, UART1_SIZE,
+ add_generic_device("s3c24x0_serial", -2, NULL, UART1_BASE, UART1_SIZE,
IORESOURCE_MEM, NULL);
return 0;
}
diff --git a/arch/arm/boards/a9m2440/a9m2440.c b/arch/arm/boards/a9m2440/a9m2440.c
index 89c9cdf..fece4ac 100644
--- a/arch/arm/boards/a9m2440/a9m2440.c
+++ b/arch/arm/boards/a9m2440/a9m2440.c
@@ -133,14 +133,14 @@ static int a9m2440_devices_init(void)
writel(reg, MISCCR);
/* ----------- the devices the boot loader should work with -------- */
- add_generic_device("s3c24x0_nand", -1, NULL, S3C24X0_NAND_BASE, 0,
+ add_generic_device("s3c24x0_nand", -2, NULL, S3C24X0_NAND_BASE, 0,
IORESOURCE_MEM, &nand_info);
/*
* cs8900 network controller onboard
* Connected to CS line 5 + A24 and interrupt line EINT9,
* data width is 16 bit
*/
- add_generic_device("cs8900", -1, NULL, CS5_BASE + (1 << 24) + 0x300, 16,
+ add_generic_device("cs8900", -2, NULL, CS5_BASE + (1 << 24) + 0x300, 16,
IORESOURCE_MEM, NULL);
#ifdef CONFIG_NAND
@@ -168,7 +168,7 @@ void __bare_init nand_boot(void)
static int a9m2440_console_init(void)
{
- add_generic_device("s3c24x0_serial", -1, NULL, UART1_BASE, UART1_SIZE,
+ add_generic_device("s3c24x0_serial", -2, NULL, UART1_BASE, UART1_SIZE,
IORESOURCE_MEM, NULL);
return 0;
}
diff --git a/arch/arm/boards/chumby_falconwing/falconwing.c b/arch/arm/boards/chumby_falconwing/falconwing.c
index 1c66eb2..db9974b 100644
--- a/arch/arm/boards/chumby_falconwing/falconwing.c
+++ b/arch/arm/boards/chumby_falconwing/falconwing.c
@@ -318,7 +318,7 @@ static void falconwing_init_usb(void)
imx_usb_phy_enable();
- add_generic_usb_ehci_device(-1, IMX_USB_BASE, NULL);
+ add_generic_usb_ehci_device(-2, IMX_USB_BASE, NULL);
}
static int falconwing_devices_init(void)
diff --git a/arch/arm/boards/edb93xx/edb93xx.c b/arch/arm/boards/edb93xx/edb93xx.c
index 3e4e0b0..1ec93f7 100644
--- a/arch/arm/boards/edb93xx/edb93xx.c
+++ b/arch/arm/boards/edb93xx/edb93xx.c
@@ -57,7 +57,7 @@ mem_initcall(ep93xx_mem_init);
static int ep93xx_devices_init(void)
{
- add_cfi_flash_device(-1, 0x60000000, EDB93XX_CFI_FLASH_SIZE, 0);
+ add_cfi_flash_device(-2, 0x60000000, EDB93XX_CFI_FLASH_SIZE, 0);
/*
* Create partitions that should be
@@ -72,7 +72,7 @@ static int ep93xx_devices_init(void)
* Up to 32MiB NOR type flash, connected to
* CS line 6, data width is 16 bit
*/
- add_generic_device("ep93xx_eth", -1, NULL, 0, 0, IORESOURCE_MEM, NULL);
+ add_generic_device("ep93xx_eth", -2, NULL, 0, 0, IORESOURCE_MEM, NULL);
armlinux_set_bootparams((void *)CONFIG_EP93XX_SDRAM_BANK0_BASE + 0x100);
@@ -101,7 +101,7 @@ static int edb93xx_console_init(void)
writel(0xAA, &syscon->sysswlock);
writel(value, &syscon->devicecfg);
- add_generic_device("pl010_serial", -1, NULL, UART1_BASE, 4096,
+ add_generic_device("pl010_serial", -2, NULL, UART1_BASE, 4096,
IORESOURCE_MEM, NULL);
return 0;
diff --git a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
index 1c54202..c589ec6 100644
--- a/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
+++ b/arch/arm/boards/eukrea_cpuimx25/eukrea_cpuimx25.c
@@ -253,9 +253,9 @@ static int eukrea_cpuimx25_devices_init(void)
#ifdef CONFIG_USB
imx25_usb_init();
- add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
+ add_generic_usb_ehci_device(-2, IMX_OTG_BASE + 0x400, NULL);
#endif
- add_generic_device("fsl-udc", -1, NULL, IMX_OTG_BASE, 0x200,
+ add_generic_device("fsl-udc", -2, NULL, IMX_OTG_BASE, 0x200,
IORESOURCE_MEM, &usb_pdata);
armlinux_set_bootparams((void *)0x80000100);
diff --git a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
index a5aadac..5ee8b54 100644
--- a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
+++ b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
@@ -191,9 +191,9 @@ static int eukrea_cpuimx27_devices_init(void)
for (i = 0; i < ARRAY_SIZE(mode); i++)
imx_gpio_mode(mode[i]);
- add_cfi_flash_device(-1, 0xC0000000, 32 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, 0xC0000000, 32 * 1024 * 1024, 0);
#ifdef CONFIG_EUKREA_CPUIMX27_NOR_64MB
- add_cfi_flash_device(-1, 0xC2000000, 32 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, 0xC2000000, 32 * 1024 * 1024, 0);
#endif
imx27_add_nand(&nand_info);
@@ -227,7 +227,7 @@ device_initcall(eukrea_cpuimx27_devices_init);
static int eukrea_cpuimx27_console_init(void)
{
#ifdef CONFIG_DRIVER_SERIAL_IMX
- imx_add_uart((void *)IMX_UART1_BASE, -1);
+ imx_add_uart((void *)IMX_UART1_BASE, -2);
#endif
/* configure 8 bit UART on cs3 */
FMCR &= ~0x2;
@@ -235,7 +235,7 @@ static int eukrea_cpuimx27_console_init(void)
CS3L = 0x0D1D0D01;
CS3A = 0x00D20000;
#ifdef CONFIG_DRIVER_SERIAL_NS16550
- add_ns16550_device(-1, IMX_CS3_BASE + QUART_OFFSET, 0xf,
+ add_ns16550_device(-2, IMX_CS3_BASE + QUART_OFFSET, 0xf,
IORESOURCE_MEM_16BIT, &quad_uart_serial_plat);
#endif
return 0;
diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
index 426445f..f047688 100644
--- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -159,13 +159,13 @@ static int eukrea_cpuimx35_devices_init(void)
#ifdef CONFIG_USB
imx35_usb_init();
- add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
+ add_generic_usb_ehci_device(-2, IMX_OTG_BASE + 0x400, NULL);
#endif
#ifdef CONFIG_USB_GADGET
/* Workaround ENGcm09152 */
tmp = readl(IMX_OTG_BASE + 0x608);
writel(tmp | (1 << 23), IMX_OTG_BASE + 0x608);
- add_generic_device("fsl-udc", -1, NULL, IMX_OTG_BASE, 0x200,
+ add_generic_device("fsl-udc", -2, NULL, IMX_OTG_BASE, 0x200,
IORESOURCE_MEM, &usb_pdata);
#endif
armlinux_set_bootparams((void *)0x80000100);
diff --git a/arch/arm/boards/freescale-mx25-3-stack/3stack.c b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
index 979115d..957e35a 100644
--- a/arch/arm/boards/freescale-mx25-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx25-3-stack/3stack.c
@@ -215,7 +215,7 @@ static int imx25_devices_init(void)
* the CPLD has to be initialized.
*/
imx25_usb_init();
- add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
+ add_generic_usb_ehci_device(-2, IMX_OTG_BASE + 0x400, NULL);
#endif
imx25_iim_register_fec_ethaddr();
diff --git a/arch/arm/boards/freescale-mx35-3-stack/3stack.c b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
index ab70265..6df644e 100644
--- a/arch/arm/boards/freescale-mx35-3-stack/3stack.c
+++ b/arch/arm/boards/freescale-mx35-3-stack/3stack.c
@@ -156,7 +156,7 @@ static int f3s_devices_init(void)
* This platform supports NOR and NAND
*/
imx35_add_nand(&nand_info);
- add_cfi_flash_device(-1, IMX_CS0_BASE, 64 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, IMX_CS0_BASE, 64 * 1024 * 1024, 0);
switch ((reg >> 25) & 0x3) {
case 0x01: /* NAND is the source */
@@ -179,7 +179,7 @@ static int f3s_devices_init(void)
imx35_add_i2c0(NULL);
imx35_add_fec(&fec_info);
- add_generic_device("smc911x", -1, NULL, IMX_CS5_BASE, IMX_CS5_RANGE,
+ add_generic_device("smc911x", -2, NULL, IMX_CS5_BASE, IMX_CS5_RANGE,
IORESOURCE_MEM, NULL);
imx35_add_mmc0(NULL);
diff --git a/arch/arm/boards/guf-neso/board.c b/arch/arm/boards/guf-neso/board.c
index 446b333..743d6b3 100644
--- a/arch/arm/boards/guf-neso/board.c
+++ b/arch/arm/boards/guf-neso/board.c
@@ -279,7 +279,7 @@ static int neso_devices_init(void)
#ifdef CONFIG_USB
neso_usbh_init();
- add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
+ add_generic_usb_ehci_device(-2, IMX_OTG_BASE + 0x400, NULL);
#endif
imx27_add_fec(&fec_info);
diff --git a/arch/arm/boards/imx21ads/imx21ads.c b/arch/arm/boards/imx21ads/imx21ads.c
index d58831e..e41a1cb 100644
--- a/arch/arm/boards/imx21ads/imx21ads.c
+++ b/arch/arm/boards/imx21ads/imx21ads.c
@@ -164,9 +164,9 @@ static int mx21ads_devices_init(void)
for (i = 0; i < ARRAY_SIZE(mode); i++)
imx_gpio_mode(mode[i]);
- add_cfi_flash_device(-1, 0xC8000000, 32 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, 0xC8000000, 32 * 1024 * 1024, 0);
imx21_add_nand(&nand_info);
- add_generic_device("cs8900", -1, NULL, IMX_CS1_BASE, 0x1000,
+ add_generic_device("cs8900", -2, NULL, IMX_CS1_BASE, 0x1000,
IORESOURCE_MEM, NULL);
imx21_add_fb(&imx_fb_data);
diff --git a/arch/arm/boards/imx27ads/imx27ads.c b/arch/arm/boards/imx27ads/imx27ads.c
index da4260f..ccd4b02 100644
--- a/arch/arm/boards/imx27ads/imx27ads.c
+++ b/arch/arm/boards/imx27ads/imx27ads.c
@@ -114,7 +114,7 @@ static int mx27ads_devices_init(void)
for (i = 0; i < ARRAY_SIZE(mode); i++)
imx_gpio_mode(mode[i]);
- add_cfi_flash_device(-1, 0xC0000000, 32 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, 0xC0000000, 32 * 1024 * 1024, 0);
imx27_add_fec(&fec_info);
devfs_add_partition("nor0", 0x00000, 0x20000, PARTITION_FIXED, "self0");
diff --git a/arch/arm/boards/mini2440/mini2440.c b/arch/arm/boards/mini2440/mini2440.c
index fd1f2f2..c69827c 100644
--- a/arch/arm/boards/mini2440/mini2440.c
+++ b/arch/arm/boards/mini2440/mini2440.c
@@ -294,7 +294,7 @@ static int mini2440_devices_init(void)
reg |= 0x10000;
writel(reg, MISCCR);
- add_generic_device("s3c24x0_nand", -1, NULL, S3C24X0_NAND_BASE, 0,
+ add_generic_device("s3c24x0_nand", -2, NULL, S3C24X0_NAND_BASE, 0,
IORESOURCE_MEM, &nand_info);
add_dm9000_device(0, CS4_BASE + 0x300, CS4_BASE + 0x304,
@@ -339,7 +339,7 @@ static int mini2440_console_init(void)
s3c_gpio_mode(GPH2_TXD0);
s3c_gpio_mode(GPH3_RXD0);
- add_generic_device("s3c24x0_serial", -1, NULL, UART1_BASE, UART1_SIZE,
+ add_generic_device("s3c24x0_serial", -2, NULL, UART1_BASE, UART1_SIZE,
IORESOURCE_MEM, NULL);
return 0;
}
diff --git a/arch/arm/boards/netx/netx.c b/arch/arm/boards/netx/netx.c
index 92d2911..cd8abd2 100644
--- a/arch/arm/boards/netx/netx.c
+++ b/arch/arm/boards/netx/netx.c
@@ -47,10 +47,10 @@ static int netx_mem_init(void)
mem_initcall(netx_mem_init);
static int netx_devices_init(void) {
- add_cfi_flash_device(-1, 0xC0000000, 32 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, 0xC0000000, 32 * 1024 * 1024, 0);
- add_generic_device("netx-eth", -1, NULL, 0, 0, IORESOURCE_MEM, ð0_data);
- add_generic_device("netx-eth", -1, NULL, 0, 0, IORESOURCE_MEM, ð1_data);
+ add_generic_device("netx-eth", -2, NULL, 0, 0, IORESOURCE_MEM, ð0_data);
+ add_generic_device("netx-eth", -2, NULL, 0, 0, IORESOURCE_MEM, ð1_data);
devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self0");
@@ -75,7 +75,7 @@ static int netx_console_init(void)
*(volatile unsigned long *)(0x00100808) = 2;
*(volatile unsigned long *)(0x0010080c) = 2;
- add_generic_device("netx_serial", -1, NULL, NETX_PA_UART0, 0x40,
+ add_generic_device("netx_serial", -2, NULL, NETX_PA_UART0, 0x40,
IORESOURCE_MEM, NULL);
return 0;
}
diff --git a/arch/arm/boards/nhk8815/setup.c b/arch/arm/boards/nhk8815/setup.c
index dcf7166..15c16a0 100644
--- a/arch/arm/boards/nhk8815/setup.c
+++ b/arch/arm/boards/nhk8815/setup.c
@@ -69,7 +69,7 @@ static struct resource nhk8815_nand_resources[] = {
};
static struct device_d nhk8815_nand_device = {
- .id = -1,
+ .id = -2,
.name = "nomadik_nand",
.num_resources = ARRAY_SIZE(nhk8815_nand_resources),
.resource = nhk8815_nand_resources,
@@ -95,7 +95,7 @@ static int nhk8815_devices_init(void)
writel(0x0000305b, FSMC_BCR(1));
writel(0x00033f33, FSMC_BTR(1));
- add_generic_device("smc91c111", -1, NULL, 0x34000300, 16,
+ add_generic_device("smc91c111", -2, NULL, 0x34000300, 16,
IORESOURCE_MEM, NULL);
register_device(&nhk8815_nand_device);
diff --git a/arch/arm/boards/omap/board-beagle.c b/arch/arm/boards/omap/board-beagle.c
index 49af40c..c9a7d2e 100644
--- a/arch/arm/boards/omap/board-beagle.c
+++ b/arch/arm/boards/omap/board-beagle.c
@@ -248,7 +248,7 @@ static struct NS16550_plat serial_plat = {
static int beagle_console_init(void)
{
/* Register the serial port */
- add_ns16550_device(-1, OMAP_UART3_BASE, 1024, IORESOURCE_MEM_8BIT,
+ add_ns16550_device(-2, OMAP_UART3_BASE, 1024, IORESOURCE_MEM_8BIT,
&serial_plat);
return 0;
@@ -289,12 +289,12 @@ mem_initcall(beagle_mem_init);
static int beagle_devices_init(void)
{
i2c_register_board_info(0, i2c_devices, ARRAY_SIZE(i2c_devices));
- add_generic_device("i2c-omap", -1, NULL, 0x4809C000, SZ_4K,
+ add_generic_device("i2c-omap", -2, NULL, 0x4809C000, SZ_4K,
IORESOURCE_MEM, NULL);
#ifdef CONFIG_USB_EHCI_OMAP
if (ehci_omap_init(&omap_ehci_pdata) >= 0)
- add_usb_ehci_device(-1, 0x48064700 + 0x100,
+ add_usb_ehci_device(-2, 0x48064700 + 0x100,
0x48064700 + 0x110, &ehci_pdata);
#endif /* CONFIG_USB_EHCI_OMAP */
#ifdef CONFIG_GPMC
@@ -303,7 +303,7 @@ static int beagle_devices_init(void)
#endif
gpmc_generic_nand_devices_init(0, 16, OMAP_ECC_HAMMING_CODE_HW_ROMCODE);
- add_generic_device("omap-hsmmc", -1, NULL, OMAP_I2C1_BASE, 0,
+ add_generic_device("omap-hsmmc", -2, NULL, OMAP_I2C1_BASE, 0,
IORESOURCE_MEM, NULL);
armlinux_set_bootparams((void *)0x80000100);
diff --git a/arch/arm/boards/omap/board-omap3evm.c b/arch/arm/boards/omap/board-omap3evm.c
index a2532d5..e894ad4 100644
--- a/arch/arm/boards/omap/board-omap3evm.c
+++ b/arch/arm/boards/omap/board-omap3evm.c
@@ -222,7 +222,7 @@ static struct NS16550_plat serial_plat = {
*/
static int omap3evm_init_console(void)
{
- add_ns16550_device(-1,
+ add_ns16550_device(-2,
#if defined(CONFIG_OMAP3EVM_UART1)
OMAP_UART1_BASE,
#elif defined(CONFIG_OMAP3EVM_UART3)
diff --git a/arch/arm/boards/omap/board-sdp343x.c b/arch/arm/boards/omap/board-sdp343x.c
index 82fc16d..9d94f09 100644
--- a/arch/arm/boards/omap/board-sdp343x.c
+++ b/arch/arm/boards/omap/board-sdp343x.c
@@ -615,7 +615,7 @@ static struct NS16550_plat serial_plat = {
static int sdp3430_console_init(void)
{
/* Register the serial port */
- add_ns16550_device(-1, OMAP_UART3_BASE, 1024, IORESOURCE_MEM_8BIT,
+ add_ns16550_device(-2, OMAP_UART3_BASE, 1024, IORESOURCE_MEM_8BIT,
&serial_plat);
return 0;
diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index 1303c47..616fa7d 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -37,7 +37,7 @@ static struct NS16550_plat serial_plat = {
static int panda_console_init(void)
{
/* Register the serial port */
- add_ns16550_device(-1, OMAP44XX_UART3_BASE, 1024, IORESOURCE_MEM_8BIT,
+ add_ns16550_device(-2, OMAP44XX_UART3_BASE, 1024, IORESOURCE_MEM_8BIT,
&serial_plat);
return 0;
@@ -87,7 +87,7 @@ static void panda_ehci_init(void)
/* enable power to hub */
gpio_set_value(GPIO_HUB_POWER, 1);
- add_usb_ehci_device(-1, 0x4a064c00,
+ add_usb_ehci_device(-2, 0x4a064c00,
0x4a064c00 + 0x10, &ehci_pdata);
}
#else
@@ -132,7 +132,7 @@ static int panda_devices_init(void)
sr32(OMAP44XX_SCRM_ALTCLKSRC, 2, 2, 0x3);
}
- add_generic_device("omap-hsmmc", -1, NULL, 0x4809C100, SZ_4K,
+ add_generic_device("omap-hsmmc", -2, NULL, 0x4809C100, SZ_4K,
IORESOURCE_MEM, NULL);
panda_ehci_init();
diff --git a/arch/arm/boards/pcm037/pcm037.c b/arch/arm/boards/pcm037/pcm037.c
index 85f004f..6d6ed3c 100644
--- a/arch/arm/boards/pcm037/pcm037.c
+++ b/arch/arm/boards/pcm037/pcm037.c
@@ -187,7 +187,7 @@ static int imx31_devices_init(void)
* Up to 32MiB NOR type flash, connected to
* CS line 0, data width is 16 bit
*/
- add_cfi_flash_device(-1, IMX_CS0_BASE, 32 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, IMX_CS0_BASE, 32 * 1024 * 1024, 0);
/*
* Create partitions that should be
@@ -211,13 +211,13 @@ static int imx31_devices_init(void)
* connected to CS line 1 and interrupt line
* GPIO3, data width is 16 bit
*/
- add_generic_device("smc911x", -1, NULL, IMX_CS1_BASE, IMX_CS1_RANGE,
+ add_generic_device("smc911x", -2, NULL, IMX_CS1_BASE, IMX_CS1_RANGE,
IORESOURCE_MEM, NULL);
#ifdef CONFIG_USB
pcm037_usb_init();
- add_generic_usb_ehci_device(-1, IMX_OTG_BASE, NULL);
- add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
+ add_generic_usb_ehci_device(-2, IMX_OTG_BASE, NULL);
+ add_generic_usb_ehci_device(-2, IMX_OTG_BASE + 0x400, NULL);
#endif
armlinux_set_bootparams((void *)0x80000100);
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index 4db50fe..bc879ab 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -243,13 +243,13 @@ static int pcm038_devices_init(void)
spi_register_board_info(pcm038_spi_board_info, ARRAY_SIZE(pcm038_spi_board_info));
imx27_add_spi0(&pcm038_spi_0_data);
- add_cfi_flash_device(-1, 0xC0000000, 32 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, 0xC0000000, 32 * 1024 * 1024, 0);
imx27_add_nand(&nand_info);
imx27_add_fb(&pcm038_fb_data);
#ifdef CONFIG_USB
pcm038_usbh_init();
- add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
+ add_generic_usb_ehci_device(-2, IMX_OTG_BASE + 0x400, NULL);
#endif
/* Register the fec device after the PLL re-initialisation
diff --git a/arch/arm/boards/pcm043/pcm043.c b/arch/arm/boards/pcm043/pcm043.c
index 966899a..3bf6c3a 100644
--- a/arch/arm/boards/pcm043/pcm043.c
+++ b/arch/arm/boards/pcm043/pcm043.c
@@ -146,7 +146,7 @@ static int imx35_devices_init(void)
* Up to 32MiB NOR type flash, connected to
* CS line 0, data width is 16 bit
*/
- add_cfi_flash_device(-1, IMX_CS0_BASE, 32 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, IMX_CS0_BASE, 32 * 1024 * 1024, 0);
if ((reg & 0xc00) == 0x800) { /* reset mode: external boot */
switch ( (reg >> 25) & 0x3) {
diff --git a/arch/arm/boards/pcm049/board.c b/arch/arm/boards/pcm049/board.c
index 502e121..5ef0d3c 100644
--- a/arch/arm/boards/pcm049/board.c
+++ b/arch/arm/boards/pcm049/board.c
@@ -48,7 +48,7 @@ static struct NS16550_plat serial_plat = {
static int pcm049_console_init(void)
{
/* Register the serial port */
- add_ns16550_device(-1, OMAP44XX_UART3_BASE, 1024, IORESOURCE_MEM_8BIT, &serial_plat);
+ add_ns16550_device(-2, OMAP44XX_UART3_BASE, 1024, IORESOURCE_MEM_8BIT, &serial_plat);
return 0;
}
@@ -81,13 +81,13 @@ static void pcm049_network_init(void)
{
gpmc_cs_config(5, &net_cfg);
- add_generic_device("smc911x", -1, NULL, 0x2C000000, 0x4000,
+ add_generic_device("smc911x", -2, NULL, 0x2C000000, 0x4000,
IORESOURCE_MEM, NULL);
}
static int pcm049_devices_init(void)
{
- add_generic_device("omap-hsmmc", -1, NULL, 0x4809C100, SZ_4K,
+ add_generic_device("omap-hsmmc", -2, NULL, 0x4809C100, SZ_4K,
IORESOURCE_MEM, NULL);
gpmc_generic_init(0x10);
diff --git a/arch/arm/boards/phycard-i.MX27/pca100.c b/arch/arm/boards/phycard-i.MX27/pca100.c
index f285466..09d7bf8 100644
--- a/arch/arm/boards/phycard-i.MX27/pca100.c
+++ b/arch/arm/boards/phycard-i.MX27/pca100.c
@@ -63,9 +63,9 @@ static void pca100_usb_register(void)
mdelay(10);
isp1504_set_vbus_power((void *)(IMX_OTG_BASE + 0x170), 1);
- add_generic_usb_ehci_device(-1, IMX_OTG_BASE, NULL);
+ add_generic_usb_ehci_device(-2, IMX_OTG_BASE, NULL);
isp1504_set_vbus_power((void *)(IMX_OTG_BASE + 0x570), 1);
- add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
+ add_generic_usb_ehci_device(-2, IMX_OTG_BASE + 0x400, NULL);
}
#endif
diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c
index e90417f..5653e48 100644
--- a/arch/arm/boards/scb9328/scb9328.c
+++ b/arch/arm/boards/scb9328/scb9328.c
@@ -88,8 +88,8 @@ static int scb9328_devices_init(void)
CS5U = 0x00008400;
CS5L = 0x00000D03;
- add_cfi_flash_device(-1, 0x10000000, 16 * 1024 * 1024, 0);
- add_dm9000_device(-1, 0x16000000, 0x16000004,
+ add_cfi_flash_device(-2, 0x10000000, 16 * 1024 * 1024, 0);
+ add_dm9000_device(-2, 0x16000000, 0x16000004,
IORESOURCE_MEM_16BIT, &dm9000_data);
devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self0");
diff --git a/arch/arm/boards/versatile/versatilepb.c b/arch/arm/boards/versatile/versatilepb.c
index 4e09de3..2f42fa9 100644
--- a/arch/arm/boards/versatile/versatilepb.c
+++ b/arch/arm/boards/versatile/versatilepb.c
@@ -50,11 +50,11 @@ mem_initcall(vpb_mem_init);
static int vpb_devices_init(void)
{
- add_cfi_flash_device(-1, VERSATILE_FLASH_BASE, VERSATILE_FLASH_SIZE, 0);
+ add_cfi_flash_device(-2, VERSATILE_FLASH_BASE, VERSATILE_FLASH_SIZE, 0);
devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self");
devfs_add_partition("nor0", 0x40000, 0x20000, PARTITION_FIXED, "env0");
- add_generic_device("smc91c111", -1, NULL, VERSATILE_ETH_BASE, 64 * 1024,
+ add_generic_device("smc91c111", -2, NULL, VERSATILE_ETH_BASE, 64 * 1024,
IORESOURCE_MEM, NULL);
armlinux_set_architecture(MACH_TYPE_VERSATILE_PB);
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index c7ae45a..f881151 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -84,7 +84,7 @@ void at91_add_device_nand(struct atmel_nand_data *data)
if (data->det_pin)
at91_set_gpio_input(data->det_pin, 1);
- add_generic_device("atmel_nand", -1, NULL, AT91_CHIPSELECT_3, 0x10,
+ add_generic_device("atmel_nand", -2, NULL, AT91_CHIPSELECT_3, 0x10,
IORESOURCE_MEM, data);
}
#else
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index f6e1eb4..5084ba2 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -88,7 +88,7 @@ void at91_add_device_nand(struct atmel_nand_data *data)
if (data->det_pin)
at91_set_gpio_input(data->det_pin, 1);
- add_generic_device("atmel_nand", -1, NULL, AT91_CHIPSELECT_3, 0x10,
+ add_generic_device("atmel_nand", -2, NULL, AT91_CHIPSELECT_3, 0x10,
IORESOURCE_MEM, data);
}
#else
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c
index 5b062f5..cccb0c1 100644
--- a/arch/arm/mach-imx/devices.c
+++ b/arch/arm/mach-imx/devices.c
@@ -10,7 +10,7 @@ static inline struct device_d *imx_add_device(char *name, int id, void *base, in
struct device_d *imx_add_fec(void *base, struct fec_platform_data *pdata)
{
- return imx_add_device("fec_imx", -1, base, 0x1000, pdata);
+ return imx_add_device("fec_imx", -2, base, 0x1000, pdata);
}
struct device_d *imx_add_spi(void *base, int id, struct spi_imx_master *pdata)
@@ -30,17 +30,17 @@ struct device_d *imx_add_uart(void *base, int id)
struct device_d *imx_add_nand(void *base, struct imx_nand_platform_data *pdata)
{
- return imx_add_device("imx_nand", -1, base, 0x1000, pdata);
+ return imx_add_device("imx_nand", -2, base, 0x1000, pdata);
}
struct device_d *imx_add_fb(void *base, struct imx_fb_platform_data *pdata)
{
- return imx_add_device("imxfb", -1, base, 0x1000, pdata);
+ return imx_add_device("imxfb", -2, base, 0x1000, pdata);
}
struct device_d *imx_add_ipufb(void *base, struct imx_ipu_fb_platform_data *pdata)
{
- return imx_add_device("imx-ipu-fb", -1, base, 0x1000, pdata);
+ return imx_add_device("imx-ipu-fb", -2, base, 0x1000, pdata);
}
struct device_d *imx_add_mmc(void *base, int id, void *pdata)
diff --git a/arch/arm/mach-omap/devices-gpmc-nand.c b/arch/arm/mach-omap/devices-gpmc-nand.c
index 76ceb20..0f09c80 100644
--- a/arch/arm/mach-omap/devices-gpmc-nand.c
+++ b/arch/arm/mach-omap/devices-gpmc-nand.c
@@ -91,7 +91,7 @@ int gpmc_generic_nand_devices_init(int cs, int width,
/* Configure GPMC CS before register */
gpmc_cs_config(nand_plat.cs, &nand_cfg);
- add_generic_device("gpmc_nand", -1, NULL, OMAP_GPMC_BASE, 1024 * 4,
+ add_generic_device("gpmc_nand", -2, NULL, OMAP_GPMC_BASE, 1024 * 4,
IORESOURCE_MEM, &nand_plat);
return 0;
diff --git a/arch/blackfin/boards/ipe337/ipe337.c b/arch/blackfin/boards/ipe337/ipe337.c
index ee642d1..4558957 100644
--- a/arch/blackfin/boards/ipe337/ipe337.c
+++ b/arch/blackfin/boards/ipe337/ipe337.c
@@ -6,7 +6,7 @@
#include <fs.h>
static int ipe337_devices_init(void) {
- add_cfi_flash_device(-1, 0x20000000, 32 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, 0x20000000, 32 * 1024 * 1024, 0);
add_mem_device("ram0", 0x0, 128 * 1024 * 1024,
IORESOURCE_MEM_WRITEABLE);
@@ -16,7 +16,7 @@ static int ipe337_devices_init(void) {
mdelay(100);
*pFIO0_FLAG_S = (1<<12);
- add_generic_device("smc911x", -1, NULL, 0x24000000, 4096,
+ add_generic_device("smc911x", -2, NULL, 0x24000000, 4096,
IORESOURCE_MEM, NULL);
devfs_add_partition("nor0", 0x00000, 0x20000, PARTITION_FIXED, "self0");
@@ -31,7 +31,7 @@ device_initcall(ipe337_devices_init);
static int blackfin_console_init(void)
{
- add_generic_device("blackfin_serial", -1, NULL, 0, 4096,
+ add_generic_device("blackfin_serial", -2, NULL, 0, 4096,
IORESOURCE_MEM, NULL);
return 0;
diff --git a/arch/mips/boards/dlink-dir-320/serial.c b/arch/mips/boards/dlink-dir-320/serial.c
index ebe8c06..ea5bb66 100644
--- a/arch/mips/boards/dlink-dir-320/serial.c
+++ b/arch/mips/boards/dlink-dir-320/serial.c
@@ -35,7 +35,7 @@ static struct NS16550_plat serial_plat = {
static int dir320_console_init(void)
{
/* Register the serial port */
- add_ns16550_device(-1, DEBUG_LL_UART_ADDR, 8,
+ add_ns16550_device(-2, DEBUG_LL_UART_ADDR, 8,
IORESOURCE_MEM_8BIT, &serial_plat);
return 0;
diff --git a/arch/mips/boards/qemu-malta/serial.c b/arch/mips/boards/qemu-malta/serial.c
index ef6be17..8846af2 100644
--- a/arch/mips/boards/qemu-malta/serial.c
+++ b/arch/mips/boards/qemu-malta/serial.c
@@ -35,7 +35,7 @@ static struct NS16550_plat serial_plat = {
static int malta_console_init(void)
{
/* Register the serial port */
- add_ns16550_device(-1, DEBUG_LL_UART_ADDR, 8,
+ add_ns16550_device(-2, DEBUG_LL_UART_ADDR, 8,
IORESOURCE_MEM_8BIT, &serial_plat);
return 0;
diff --git a/arch/nios2/boards/generic/generic.c b/arch/nios2/boards/generic/generic.c
index 0e3852b..84fe5b8 100644
--- a/arch/nios2/boards/generic/generic.c
+++ b/arch/nios2/boards/generic/generic.c
@@ -25,7 +25,7 @@ static struct resource mac_resources[] = {
};
static struct device_d mac_dev = {
- .id = -1,
+ .id = -2,
.name = "altera_tse",
.num_resources = ARRAY_SIZE(mac_resources),
.resource = mac_resources,
@@ -34,7 +34,7 @@ static struct device_d mac_dev = {
static int generic_devices_init(void)
{
- add_cfi_flash_device(-1, NIOS_SOPC_FLASH_BASE, NIOS_SOPC_FLASH_SIZE, 0);
+ add_cfi_flash_device(-2, NIOS_SOPC_FLASH_BASE, NIOS_SOPC_FLASH_SIZE, 0);
add_mem_device("ram0", NIOS_SOPC_MEMORY_BASE, NIOS_SOPC_MEMORY_SIZE,
IORESOURCE_MEM_WRITEABLE);
register_device(&mac_dev);
@@ -53,7 +53,7 @@ device_initcall(generic_devices_init);
static int altera_console_init(void)
{
- add_generic_device("altera_serial", -1, NULL, NIOS_SOPC_UART_BASE, 0x20,
+ add_generic_device("altera_serial", -2, NULL, NIOS_SOPC_UART_BASE, 0x20,
IORESOURCE_MEM, NULL);
return 0;
diff --git a/arch/ppc/boards/pcm030/pcm030.c b/arch/ppc/boards/pcm030/pcm030.c
index ba59bfe..7fcfc22 100644
--- a/arch/ppc/boards/pcm030/pcm030.c
+++ b/arch/ppc/boards/pcm030/pcm030.c
@@ -43,10 +43,10 @@ static struct mpc5xxx_fec_platform_data fec_info = {
static int devices_init (void)
{
- add_cfi_flash_device(-1, 0xff000000, 16 * 1024 * 1024, 0);
+ add_cfi_flash_device(-2, 0xff000000, 16 * 1024 * 1024, 0);
add_mem_device("ram0", 0x0, 64 * 1024 * 1024,
IORESOURCE_MEM_WRITEABLE);
- add_generic_device("fec_mpc5xxx", -1, NULL, MPC5XXX_FEC, 0,
+ add_generic_device("fec_mpc5xxx", -2, NULL, MPC5XXX_FEC, 0,
IORESOURCE_MEM, &fec_info);
devfs_add_partition("nor0", 0x00f00000, 0x40000, PARTITION_FIXED, "self0");
@@ -59,9 +59,9 @@ device_initcall(devices_init);
static int console_init(void)
{
- add_generic_device("mpc5xxx_serial", -1, NULL, MPC5XXX_PSC3, 4096,
+ add_generic_device("mpc5xxx_serial", -2, NULL, MPC5XXX_PSC3, 4096,
IORESOURCE_MEM, NULL);
- add_generic_device("mpc5xxx_serial", -1, NULL, MPC5XXX_PSC6, 4096,
+ add_generic_device("mpc5xxx_serial", -2, NULL, MPC5XXX_PSC6, 4096,
IORESOURCE_MEM, NULL);
return 0;
}
diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index f5452af..b3a7cd3 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -102,7 +102,7 @@ device_initcall(hf_init);
int barebox_register_filedev(struct hf_platform_data *hf)
{
- return !add_generic_device("hostfile", -1, NULL, hf->base, hf->size,
+ return !add_generic_device("hostfile", -2, NULL, hf->base, hf->size,
IORESOURCE_MEM, hf);
}
diff --git a/arch/x86/boards/x86_generic/generic_pc.c b/arch/x86/boards/x86_generic/generic_pc.c
index 0ddf883..2371b8d 100644
--- a/arch/x86/boards/x86_generic/generic_pc.c
+++ b/arch/x86/boards/x86_generic/generic_pc.c
@@ -51,7 +51,7 @@ static int devices_init(void)
/* extended memory only */
add_mem_device("ram0", 0x0, bios_get_memsize() << 10,
IORESOURCE_MEM_WRITEABLE);
- add_generic_device("biosdrive", -1, NULL, 0, 0, IORESOURCE_MEM, NULL);
+ add_generic_device("biosdrive", -2, NULL, 0, 0, IORESOURCE_MEM, NULL);
if (pers_env_size != PATCH_AREA_PERS_SIZE_UNUSED) {
rc = devfs_add_partition("biosdisk0",
@@ -77,7 +77,7 @@ static struct NS16550_plat serial_plat = {
static int pc_console_init(void)
{
/* Register the serial port */
- add_ns16550_device(-1, 0x3f8, 8, 0, &serial_plat);
+ add_ns16550_device(-2, 0x3f8, 8, 0, &serial_plat);
return 0;
}
diff --git a/common/console.c b/common/console.c
index 1f6ee93..6c88fba 100644
--- a/common/console.c
+++ b/common/console.c
@@ -129,7 +129,7 @@ int console_register(struct console_device *newcdev)
int first = 0;
char ch;
- dev->id = -1;
+ dev->id = -2;
strcpy(dev->name, "cs");
dev->type_data = newcdev;
if (newcdev->dev)
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 0b80103..dfd81c5 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -103,7 +103,7 @@ int register_device(struct device_d *new_device)
{
struct driver_d *drv;
- if (new_device->id < 0) {
+ if (new_device->id == -2) {
new_device->id = get_free_deviceid(new_device->name);
} else {
if (get_device_by_name_id(new_device->name, new_device->id)) {
@@ -267,6 +267,9 @@ const char *dev_id(const struct device_d *dev)
{
static char buf[MAX_DRIVER_NAME + 16];
+ if (dev->id == -1)
+ return dev->name;
+
snprintf(buf, sizeof(buf), FORMAT_DRIVER_NAME_ID, dev->name, dev->id);
return buf;
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 681de0a..ce3c1eb 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1229,7 +1229,7 @@ static int mci_card_probe(struct device_d *mci_dev)
p->read = mci_sd_read;
p->priv = mci_dev;
- dev = add_generic_device("disk", -1, NULL, 0, mci->capacity, IORESOURCE_MEM, p);
+ dev = add_generic_device("disk", -2, NULL, 0, mci->capacity, IORESOURCE_MEM, p);
dev_add_child(&host->dev, dev);
pr_debug("SD Card successfully added\n");
diff --git a/drivers/net/miidev.c b/drivers/net/miidev.c
index 501a4f8..fe02db7 100644
--- a/drivers/net/miidev.c
+++ b/drivers/net/miidev.c
@@ -208,7 +208,7 @@ static struct driver_d miidev_drv = {
int mii_register(struct mii_device *mdev)
{
mdev->dev.priv = mdev;
- mdev->dev.id = -1;
+ mdev->dev.id = -2;
strcpy(mdev->dev.name, "miidev");
if (mdev->parent)
dev_add_child(mdev->parent, &mdev->dev);
diff --git a/include/driver.h b/include/driver.h
index e9ac727..0b5a652 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -210,7 +210,7 @@ struct device_d *add_generic_device(const char* devname, int id, const char *res
static inline struct device_d *add_mem_device(const char *name, resource_size_t start,
resource_size_t size, unsigned int flags)
{
- return add_generic_device("mem", -1, name, start, size,
+ return add_generic_device("mem", -2, name, start, size,
IORESOURCE_MEM | flags, NULL);
}
diff --git a/net/eth.c b/net/eth.c
index 621cb59..406a4e6 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -198,7 +198,7 @@ int eth_register(struct eth_device *edev)
}
strcpy(edev->dev.name, "eth");
- edev->dev.id = -1;
+ edev->dev.id = -2;
if (edev->parent)
dev_add_child(edev->parent, &edev->dev);
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 4/4] switch all device/driver to platform_device/driver_(un)register
2011-08-15 8:46 [PATCH] parent fixups Sascha Hauer
` (10 preceding siblings ...)
2011-08-16 5:36 ` [PATCH 3/4] platform_bus: add registrattion to bus Jean-Christophe PLAGNIOL-VILLARD
@ 2011-08-16 5:36 ` Jean-Christophe PLAGNIOL-VILLARD
11 siblings, 0 replies; 19+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-08-16 5:36 UTC (permalink / raw)
To: barebox
now (un)register_device/driver are only use by bus implementation
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/boards/nhk8815/setup.c | 2 +-
arch/arm/mach-imx/iim.c | 2 +-
arch/arm/mach-omap/arch-omap.dox | 2 +-
arch/nios2/boards/generic/generic.c | 4 ++--
arch/sandbox/board/board.c | 2 +-
arch/sandbox/board/console.c | 2 +-
arch/sandbox/board/hostfile.c | 2 +-
commands/mem.c | 2 +-
common/console.c | 2 +-
drivers/ata/bios.c | 4 ++--
drivers/ata/disk_drive.c | 4 ++--
drivers/base/driver.c | 11 ++++-------
drivers/base/platform.c | 17 +++++++++++++++++
drivers/base/resource.c | 6 +++---
drivers/eeprom/at25.c | 2 +-
drivers/i2c/busses/i2c-imx.c | 2 +-
drivers/i2c/busses/i2c-omap.c | 2 +-
drivers/i2c/i2c.c | 2 +-
drivers/mci/atmel_mci.c | 2 +-
drivers/mci/imx-esdhc.c | 2 +-
drivers/mci/imx.c | 2 +-
drivers/mci/mci-core.c | 4 ++--
drivers/mci/mxs.c | 2 +-
drivers/mci/omap_hsmmc.c | 2 +-
drivers/mci/s3c.c | 2 +-
drivers/mfd/lp3972.c | 2 +-
drivers/mfd/mc13783.c | 2 +-
drivers/mfd/mc13892.c | 4 ++--
drivers/mfd/mc34704.c | 2 +-
drivers/mfd/mc9sdz60.c | 2 +-
drivers/mfd/twl4030.c | 2 +-
drivers/mtd/nand/atmel_nand.c | 2 +-
drivers/mtd/nand/nand.c | 4 ++--
drivers/mtd/nand/nand_imx.c | 2 +-
drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
drivers/mtd/nand/nand_s3c2410.c | 2 +-
drivers/mtd/nand/nomadik_nand.c | 2 +-
drivers/net/altera_tse.c | 2 +-
drivers/net/at91_ether.c | 2 +-
drivers/net/cs8900.c | 2 +-
drivers/net/dm9000.c | 2 +-
drivers/net/ep93xx.c | 2 +-
drivers/net/fec_imx.c | 2 +-
drivers/net/fec_mpc5200.c | 2 +-
drivers/net/macb.c | 2 +-
drivers/net/miidev.c | 6 +++---
drivers/net/netx_eth.c | 2 +-
drivers/net/smc91111.c | 2 +-
drivers/net/smc911x.c | 2 +-
drivers/net/tap.c | 2 +-
drivers/net/usb/usbnet.c | 2 +-
drivers/nor/cfi_flash.c | 2 +-
drivers/serial/amba-pl011.c | 2 +-
drivers/serial/arm_dcc.c | 4 ++--
drivers/serial/atmel.c | 2 +-
drivers/serial/linux_console.c | 2 +-
drivers/serial/serial_altera.c | 2 +-
drivers/serial/serial_altera_jtag.c | 2 +-
drivers/serial/serial_blackfin.c | 2 +-
drivers/serial/serial_imx.c | 2 +-
drivers/serial/serial_mpc5xxx.c | 2 +-
drivers/serial/serial_netx.c | 2 +-
drivers/serial/serial_ns16550.c | 4 ++--
drivers/serial/serial_pl010.c | 2 +-
drivers/serial/serial_s3c24x0.c | 2 +-
drivers/serial/stm-serial.c | 2 +-
drivers/spi/imx_spi.c | 2 +-
drivers/spi/spi.c | 4 ++--
drivers/usb/core/usb.c | 6 +++---
drivers/usb/gadget/composite.c | 4 ++--
drivers/usb/gadget/fsl_udc.c | 10 +++++-----
drivers/usb/host/ehci-hcd.c | 2 +-
drivers/video/fb.c | 4 ++--
drivers/video/imx-ipu-fb.c | 2 +-
drivers/video/imx.c | 2 +-
drivers/video/s3c.c | 2 +-
drivers/video/stm.c | 2 +-
fs/fs.c | 8 ++++----
include/driver.h | 8 ++++++++
net/eth.c | 2 +-
80 files changed, 130 insertions(+), 108 deletions(-)
diff --git a/arch/arm/boards/nhk8815/setup.c b/arch/arm/boards/nhk8815/setup.c
index 15c16a0..97efcfb 100644
--- a/arch/arm/boards/nhk8815/setup.c
+++ b/arch/arm/boards/nhk8815/setup.c
@@ -98,7 +98,7 @@ static int nhk8815_devices_init(void)
add_generic_device("smc91c111", -2, NULL, 0x34000300, 16,
IORESOURCE_MEM, NULL);
- register_device(&nhk8815_nand_device);
+ platform_device_register(&nhk8815_nand_device);
armlinux_set_architecture(MACH_TYPE_NOMADIK);
armlinux_set_bootparams((void *)(0x00000100));
diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index ca89710..3e6b80f 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -295,7 +295,7 @@ static struct driver_d imx_iim_driver = {
static int imx_iim_init(void)
{
- register_driver(&imx_iim_driver);
+ platform_driver_register(&imx_iim_driver);
return 0;
}
diff --git a/arch/arm/mach-omap/arch-omap.dox b/arch/arm/mach-omap/arch-omap.dox
index 9c90b4f..6b6b3a8 100644
--- a/arch/arm/mach-omap/arch-omap.dox
+++ b/arch/arm/mach-omap/arch-omap.dox
@@ -85,7 +85,7 @@ static struct device_d my_little_device = {
};
static int my_board_devices_init(void) {
/* Do Blah Blah Blah */
- return register_device(&my_little_device);
+ return platform_device_register(&my_little_device);
}
device_initcall(my_board_devices_init);
diff --git a/arch/nios2/boards/generic/generic.c b/arch/nios2/boards/generic/generic.c
index 84fe5b8..7bf0dc8 100644
--- a/arch/nios2/boards/generic/generic.c
+++ b/arch/nios2/boards/generic/generic.c
@@ -37,8 +37,8 @@ static int generic_devices_init(void)
add_cfi_flash_device(-2, NIOS_SOPC_FLASH_BASE, NIOS_SOPC_FLASH_SIZE, 0);
add_mem_device("ram0", NIOS_SOPC_MEMORY_BASE, NIOS_SOPC_MEMORY_SIZE,
IORESOURCE_MEM_WRITEABLE);
- register_device(&mac_dev);
- /*register_device(&epcs_flash_device);*/
+ platform_device_register(&mac_dev);
+ /*platform_device_register(&epcs_flash_device);*/
devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self0");
devfs_add_partition("nor0", 0x40000, 0x20000, PARTITION_FIXED, "env0");
diff --git a/arch/sandbox/board/board.c b/arch/sandbox/board/board.c
index 7d489fd..e3d2587 100644
--- a/arch/sandbox/board/board.c
+++ b/arch/sandbox/board/board.c
@@ -34,7 +34,7 @@ static struct device_d tap_device = {
static int devices_init(void)
{
- register_device(&tap_device);
+ platform_device_register(&tap_device);
return 0;
}
diff --git a/arch/sandbox/board/console.c b/arch/sandbox/board/console.c
index 2959e85..474953c 100644
--- a/arch/sandbox/board/console.c
+++ b/arch/sandbox/board/console.c
@@ -47,6 +47,6 @@ int barebox_register_console(char *name, int stdinfd, int stdoutfd)
data->stdoutfd = stdoutfd;
data->stdinfd = stdinfd;
- return register_device(dev);
+ return platform_device_register(dev);
}
diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index b3a7cd3..54d4906 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -95,7 +95,7 @@ static struct driver_d hf_drv = {
static int hf_init(void)
{
- return register_driver(&hf_drv);
+ return platform_driver_register(&hf_drv);
}
device_initcall(hf_init);
diff --git a/commands/mem.c b/commands/mem.c
index 88af55c..e0e0e6e 100644
--- a/commands/mem.c
+++ b/commands/mem.c
@@ -619,7 +619,7 @@ static int mem_init(void)
}
add_mem_device("mem", 0, ~0, IORESOURCE_MEM_WRITEABLE);
- register_driver(&mem_drv);
+ platform_driver_register(&mem_drv);
return 0;
}
diff --git a/common/console.c b/common/console.c
index 6c88fba..ffd886e 100644
--- a/common/console.c
+++ b/common/console.c
@@ -134,7 +134,7 @@ int console_register(struct console_device *newcdev)
dev->type_data = newcdev;
if (newcdev->dev)
dev_add_child(newcdev->dev, dev);
- register_device(dev);
+ platform_device_register(dev);
if (newcdev->setbrg) {
dev_add_param(dev, "baudrate", console_baudrate_set, NULL, 0);
diff --git a/drivers/ata/bios.c b/drivers/ata/bios.c
index 6e2377c..4aac33b 100644
--- a/drivers/ata/bios.c
+++ b/drivers/ata/bios.c
@@ -260,7 +260,7 @@ static int biosdisk_probe(struct device_d *dev)
drive_dev->resource[0].start = 0;
drive_dev->platform_data = p;
- register_device(drive_dev);
+ platform_device_register(drive_dev);
}
return 0;
@@ -283,7 +283,7 @@ static int biosdisk_init(void)
return -EIO;
}
- register_driver(&biosdisk_driver);
+ platform_driver_register(&biosdisk_driver);
return 0;
}
diff --git a/drivers/ata/disk_drive.c b/drivers/ata/disk_drive.c
index 14b5e66..6123ca2 100644
--- a/drivers/ata/disk_drive.c
+++ b/drivers/ata/disk_drive.c
@@ -233,9 +233,9 @@ static struct driver_d disk_driver = {
static int disk_init(void)
{
#ifdef CONFIG_ATA_BIOS
- register_driver(&biosdisk_driver);
+ platform_driver_register(&biosdisk_driver);
#endif
- register_driver(&disk_driver);
+ platform_driver_register(&disk_driver);
return 0;
}
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 33eb016..b0d614b 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -116,13 +116,10 @@ int register_device(struct device_d *new_device)
debug ("register_device: %s\n", dev_name(new_device));
if (!new_device->bus) {
-// dev_err(new_device, "no bus type associated. Needs fixup\n");
- new_device->bus = &platform_bus;
+ dev_err(new_device, "no bus type associated. Needs fixup\n");
+ return -EIO;
}
- if (!new_device->parent && new_device->bus == &platform_bus)
- dev_add_child(&platform_bus_device, new_device);
-
list_add_tail(&new_device->list, &device_list);
INIT_LIST_HEAD(&new_device->children);
INIT_LIST_HEAD(&new_device->cdevs);
@@ -199,8 +196,8 @@ int register_driver(struct driver_d *drv)
debug("register_driver: %s\n", drv->name);
if (!drv->bus) {
-// pr_err("driver %s has no bus type associated. Needs fixup\n", drv->name);
- drv->bus = &platform_bus;
+ pr_err("driver %s has no bus type associated. Needs fixup\n", drv->name);
+ return -EIO;
}
list_add_tail(&drv->list, &driver_list);
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 60c87d3..32f25d0 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -50,6 +50,23 @@ struct device_d platform_bus_device = {
.name = "platform",
};
+int platform_driver_register(struct driver_d *drv)
+{
+ drv->bus = &platform_bus;
+
+ return register_driver(drv);
+}
+
+int platform_device_register(struct device_d *dev)
+{
+ dev->bus = &platform_bus;
+
+ if (!dev->parent)
+ dev_add_child(&platform_bus_device, dev);
+
+ return register_device(dev);
+}
+
static int platform_bus_init(void)
{
register_bus_device(&platform_bus_device);
diff --git a/drivers/base/resource.c b/drivers/base/resource.c
index 175beb9..e8a47e6 100644
--- a/drivers/base/resource.c
+++ b/drivers/base/resource.c
@@ -52,7 +52,7 @@ struct device_d *add_generic_device(const char* devname, int id, const char *res
dev->resource[0].size = size;
dev->resource[0].flags = flags;
- register_device(dev);
+ platform_device_register(dev);
return dev;
}
@@ -91,7 +91,7 @@ struct device_d *add_dm9000_device(int id, resource_size_t base,
dev->resource[1].size = size;
dev->resource[1].flags = IORESOURCE_MEM | flags;
- register_device(dev);
+ platform_device_register(dev);
return dev;
}
@@ -112,7 +112,7 @@ struct device_d *add_usb_ehci_device(int id, resource_size_t hccr,
dev->resource[1].start = hcor;
dev->resource[1].flags = IORESOURCE_MEM;
- register_device(dev);
+ platform_device_register(dev);
return dev;
}
diff --git a/drivers/eeprom/at25.c b/drivers/eeprom/at25.c
index 8a979d5..f8e3a18 100644
--- a/drivers/eeprom/at25.c
+++ b/drivers/eeprom/at25.c
@@ -312,7 +312,7 @@ static struct driver_d at25_driver = {
static int at25_init(void)
{
- register_driver(&at25_driver);
+ platform_driver_register(&at25_driver);
return 0;
}
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 2d075f7..2ae3050 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -502,6 +502,6 @@ static struct driver_d i2c_imx_driver = {
static int __init i2c_adap_imx_init(void)
{
- return register_driver(&i2c_imx_driver);
+ return platform_driver_register(&i2c_imx_driver);
}
device_initcall(i2c_adap_imx_init);
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 95c4fdf..b84a2f8 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -793,7 +793,7 @@ static struct driver_d omap_i2c_driver = {
/* I2C may be needed to bring up other drivers */
static int __init omap_i2c_init_driver(void)
{
- return register_driver(&omap_i2c_driver);
+ return platform_driver_register(&omap_i2c_driver);
}
device_initcall(omap_i2c_init_driver);
diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index 5df0d30..489e38c 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -253,7 +253,7 @@ struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
client->adapter = adapter;
client->addr = chip->addr;
- status = register_device(&client->dev);
+ status = platform_device_register(&client->dev);
#if 0
/* drivers may modify this initial i/o setup */
diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index 47e3924..a213a12 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -488,7 +488,7 @@ static struct driver_d atmel_mci_driver = {
static int atmel_mci_init_driver(void)
{
- register_driver(&atmel_mci_driver);
+ platform_driver_register(&atmel_mci_driver);
return 0;
}
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index 358f0dc..d38144a 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -506,7 +506,7 @@ static struct driver_d fsl_esdhc_driver = {
static int fsl_esdhc_init_driver(void)
{
- register_driver(&fsl_esdhc_driver);
+ platform_driver_register(&fsl_esdhc_driver);
return 0;
}
diff --git a/drivers/mci/imx.c b/drivers/mci/imx.c
index 905c251..6705e4c 100644
--- a/drivers/mci/imx.c
+++ b/drivers/mci/imx.c
@@ -513,7 +513,7 @@ static struct driver_d mxcmci_driver = {
static int mxcmci_init_driver(void)
{
- register_driver(&mxcmci_driver);
+ platform_driver_register(&mxcmci_driver);
return 0;
}
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index ce3c1eb..9ee9e8e 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1349,7 +1349,7 @@ static struct driver_d mci_driver = {
static int mci_init(void)
{
sector_buf = xmemalign(32, 512);
- return register_driver(&mci_driver);
+ return platform_driver_register(&mci_driver);
}
device_initcall(mci_init);
@@ -1367,5 +1367,5 @@ int mci_register(struct mci_host *host)
mci_dev->platform_data = (void*)host;
dev_add_child(host->hw_dev, mci_dev);
- return register_device(mci_dev);
+ return platform_device_register(mci_dev);
}
diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c
index 70b8be9..f45f635 100644
--- a/drivers/mci/mxs.c
+++ b/drivers/mci/mxs.c
@@ -766,7 +766,7 @@ static struct driver_d mxs_mci_driver = {
static int mxs_mci_init_driver(void)
{
- register_driver(&mxs_mci_driver);
+ platform_driver_register(&mxs_mci_driver);
return 0;
}
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index 5fdf445..1ca0d64 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -578,7 +578,7 @@ static struct driver_d omap_mmc_driver = {
static int omap_mmc_init_driver(void)
{
- register_driver(&omap_mmc_driver);
+ platform_driver_register(&omap_mmc_driver);
return 0;
}
diff --git a/drivers/mci/s3c.c b/drivers/mci/s3c.c
index c621445..7b3e0a1 100644
--- a/drivers/mci/s3c.c
+++ b/drivers/mci/s3c.c
@@ -823,7 +823,7 @@ static struct driver_d s3c_mci_driver = {
static int s3c_mci_init_driver(void)
{
- register_driver(&s3c_mci_driver);
+ platform_driver_register(&s3c_mci_driver);
return 0;
}
diff --git a/drivers/mfd/lp3972.c b/drivers/mfd/lp3972.c
index 9826699..ca7ba57 100644
--- a/drivers/mfd/lp3972.c
+++ b/drivers/mfd/lp3972.c
@@ -103,7 +103,7 @@ static struct driver_d lp_driver = {
static int lp_init(void)
{
- register_driver(&lp_driver);
+ platform_driver_register(&lp_driver);
return 0;
}
diff --git a/drivers/mfd/mc13783.c b/drivers/mfd/mc13783.c
index 19e2780..7bd4145 100644
--- a/drivers/mfd/mc13783.c
+++ b/drivers/mfd/mc13783.c
@@ -229,7 +229,7 @@ static struct driver_d pmic_driver = {
static int pmic_init(void)
{
- register_driver(&pmic_driver);
+ platform_driver_register(&pmic_driver);
return 0;
}
diff --git a/drivers/mfd/mc13892.c b/drivers/mfd/mc13892.c
index b2cc911..3fcba4a 100644
--- a/drivers/mfd/mc13892.c
+++ b/drivers/mfd/mc13892.c
@@ -319,8 +319,8 @@ static struct driver_d mc_spi_driver = {
static int mc_init(void)
{
- register_driver(&mc_i2c_driver);
- register_driver(&mc_spi_driver);
+ platform_driver_register(&mc_i2c_driver);
+ platform_driver_register(&mc_spi_driver);
return 0;
}
diff --git a/drivers/mfd/mc34704.c b/drivers/mfd/mc34704.c
index a2171b3..37a0280 100644
--- a/drivers/mfd/mc34704.c
+++ b/drivers/mfd/mc34704.c
@@ -134,7 +134,7 @@ static struct driver_d mc34704_driver = {
static int mc34704_init(void)
{
- register_driver(&mc34704_driver);
+ platform_driver_register(&mc34704_driver);
return 0;
}
device_initcall(mc34704_init);
diff --git a/drivers/mfd/mc9sdz60.c b/drivers/mfd/mc9sdz60.c
index db208ec..9121c0a 100644
--- a/drivers/mfd/mc9sdz60.c
+++ b/drivers/mfd/mc9sdz60.c
@@ -146,7 +146,7 @@ static struct driver_d mc_driver = {
static int mc_init(void)
{
- register_driver(&mc_driver);
+ platform_driver_register(&mc_driver);
return 0;
}
diff --git a/drivers/mfd/twl4030.c b/drivers/mfd/twl4030.c
index 6a06bd4..2ab714b 100644
--- a/drivers/mfd/twl4030.c
+++ b/drivers/mfd/twl4030.c
@@ -179,7 +179,7 @@ static struct driver_d twl_driver = {
static int twl_init(void)
{
- register_driver(&twl_driver);
+ platform_driver_register(&twl_driver);
return 0;
}
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index f79be9a..06b1ba4 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -506,7 +506,7 @@ static struct driver_d atmel_nand_driver = {
static int __init atmel_nand_init(void)
{
- return register_driver(&atmel_nand_driver);
+ return platform_driver_register(&atmel_nand_driver);
}
device_initcall(atmel_nand_init);
diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index 9423ac8..ae74324 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -254,7 +254,7 @@ int add_mtd_device(struct mtd_info *mtd)
char str[16];
strcpy(mtd->class_dev.name, "nand");
- register_device(&mtd->class_dev);
+ platform_device_register(&mtd->class_dev);
mtd->cdev.ops = &nand_ops;
mtd->cdev.size = mtd->size;
@@ -275,7 +275,7 @@ int add_mtd_device(struct mtd_info *mtd)
int del_mtd_device (struct mtd_info *mtd)
{
- unregister_device(&mtd->class_dev);
+ platform_device_unregister(&mtd->class_dev);
nand_exit_oob_cdev(mtd);
free(mtd->param_size.value);
free(mtd->cdev.name);
diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c
index e471c8a..bcb8a24 100644
--- a/drivers/mtd/nand/nand_imx.c
+++ b/drivers/mtd/nand/nand_imx.c
@@ -1185,7 +1185,7 @@ static struct driver_d imx_nand_driver = {
*/
static int __init imx_nand_init(void)
{
- return register_driver(&imx_nand_driver);
+ return platform_driver_register(&imx_nand_driver);
}
device_initcall(imx_nand_init);
diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index 083aa57..b5d35fd 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -842,7 +842,7 @@ static struct driver_d gpmc_nand_driver = {
static int gpmc_nand_init(void)
{
- return register_driver(&gpmc_nand_driver);
+ return platform_driver_register(&gpmc_nand_driver);
}
device_initcall(gpmc_nand_init);
diff --git a/drivers/mtd/nand/nand_s3c2410.c b/drivers/mtd/nand/nand_s3c2410.c
index 0ce20d4..bdb8858 100644
--- a/drivers/mtd/nand/nand_s3c2410.c
+++ b/drivers/mtd/nand/nand_s3c2410.c
@@ -644,7 +644,7 @@ BAREBOX_CMD_END
*/
static int __init s3c24x0_nand_init(void)
{
- return register_driver(&s3c24x0_nand_driver);
+ return platform_driver_register(&s3c24x0_nand_driver);
}
device_initcall(s3c24x0_nand_init);
diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c
index 3073011..e9ff8b6 100644
--- a/drivers/mtd/nand/nomadik_nand.c
+++ b/drivers/mtd/nand/nomadik_nand.c
@@ -237,7 +237,7 @@ static struct driver_d nomadik_nand_driver = {
static int __init nand_nomadik_init(void)
{
pr_info("Nomadik NAND driver\n");
- return register_driver(&nomadik_nand_driver);
+ return platform_driver_register(&nomadik_nand_driver);
}
device_initcall(nand_nomadik_init);
diff --git a/drivers/net/altera_tse.c b/drivers/net/altera_tse.c
index 7e456c7..2b9eea8 100644
--- a/drivers/net/altera_tse.c
+++ b/drivers/net/altera_tse.c
@@ -570,7 +570,7 @@ static struct driver_d altera_tse_driver = {
static int tse_init(void)
{
- register_driver(&altera_tse_driver);
+ platform_driver_register(&altera_tse_driver);
return 0;
}
diff --git a/drivers/net/at91_ether.c b/drivers/net/at91_ether.c
index 8d0b43b..1d477f9 100644
--- a/drivers/net/at91_ether.c
+++ b/drivers/net/at91_ether.c
@@ -337,7 +337,7 @@ static struct driver_d at91_eth_driver = {
static int at91_eth_init(void)
{
- register_driver(&at91_eth_driver);
+ platform_driver_register(&at91_eth_driver);
return 0;
}
diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index 33afc5e..c1766eb 100644
--- a/drivers/net/cs8900.c
+++ b/drivers/net/cs8900.c
@@ -472,7 +472,7 @@ static struct driver_d cs8900_driver = {
static int cs8900_init(void)
{
- register_driver(&cs8900_driver);
+ platform_driver_register(&cs8900_driver);
return 0;
}
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index e9ec61b..feefd63 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -556,7 +556,7 @@ static struct driver_d dm9000_driver = {
static int dm9000_init(void)
{
- register_driver(&dm9000_driver);
+ platform_driver_register(&dm9000_driver);
return 0;
}
diff --git a/drivers/net/ep93xx.c b/drivers/net/ep93xx.c
index 954ec78..c901090 100644
--- a/drivers/net/ep93xx.c
+++ b/drivers/net/ep93xx.c
@@ -662,7 +662,7 @@ static struct driver_d ep93xx_eth_driver = {
static int ep93xx_eth_init(void)
{
- register_driver(&ep93xx_eth_driver);
+ platform_driver_register(&ep93xx_eth_driver);
return 0;
}
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 3b0f266..b307502 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -672,7 +672,7 @@ static struct driver_d fec_driver = {
static int fec_register(void)
{
- register_driver(&fec_driver);
+ platform_driver_register(&fec_driver);
return 0;
}
diff --git a/drivers/net/fec_mpc5200.c b/drivers/net/fec_mpc5200.c
index 403aad5..aa77dba 100644
--- a/drivers/net/fec_mpc5200.c
+++ b/drivers/net/fec_mpc5200.c
@@ -704,7 +704,7 @@ static struct driver_d mpc5xxx_driver = {
static int mpc5xxx_fec_register(void)
{
- register_driver(&mpc5xxx_driver);
+ platform_driver_register(&mpc5xxx_driver);
return 0;
}
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 898cf3d..77a3cd1 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -486,7 +486,7 @@ static struct driver_d macb_driver = {
static int macb_driver_init(void)
{
debug("%s\n", __func__);
- register_driver(&macb_driver);
+ platform_driver_register(&macb_driver);
return 0;
}
diff --git a/drivers/net/miidev.c b/drivers/net/miidev.c
index fe02db7..d616c10 100644
--- a/drivers/net/miidev.c
+++ b/drivers/net/miidev.c
@@ -213,17 +213,17 @@ int mii_register(struct mii_device *mdev)
if (mdev->parent)
dev_add_child(mdev->parent, &mdev->dev);
- return register_device(&mdev->dev);
+ return platform_device_register(&mdev->dev);
}
void mii_unregister(struct mii_device *mdev)
{
- unregister_device(&mdev->dev);
+ platform_device_unregister(&mdev->dev);
}
static int miidev_init(void)
{
- register_driver(&miidev_drv);
+ platform_driver_register(&miidev_drv);
return 0;
}
diff --git a/drivers/net/netx_eth.c b/drivers/net/netx_eth.c
index 5503bc9..e136c81 100644
--- a/drivers/net/netx_eth.c
+++ b/drivers/net/netx_eth.c
@@ -280,7 +280,7 @@ static struct driver_d netx_eth_driver = {
static int netx_eth_init(void)
{
- register_driver(&netx_eth_driver);
+ platform_driver_register(&netx_eth_driver);
return 0;
}
diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
index 2313aae..d478e9c 100644
--- a/drivers/net/smc91111.c
+++ b/drivers/net/smc91111.c
@@ -1336,7 +1336,7 @@ static struct driver_d smc91c111_driver = {
static int smc91c111_init(void)
{
- register_driver(&smc91c111_driver);
+ platform_driver_register(&smc91c111_driver);
return 0;
}
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index fba61c4..6acba9c 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -751,7 +751,7 @@ static struct driver_d smc911x_driver = {
static int smc911x_init(void)
{
- register_driver(&smc911x_driver);
+ platform_driver_register(&smc911x_driver);
return 0;
}
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index a30a9c8..38c3ae7 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -115,7 +115,7 @@ static struct driver_d tap_driver = {
static int tap_init(void)
{
- register_driver(&tap_driver);
+ platform_driver_register(&tap_driver);
return 0;
}
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 5ffd7a6..da740ce 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -236,7 +236,7 @@ void usbnet_disconnect(struct usb_device *usbdev)
struct driver_info *info;
eth_unregister(edev);
- unregister_device(&edev->dev);
+ platform_device_unregister(&edev->dev);
info = undev->driver_info;
if (info->unbind)
diff --git a/drivers/nor/cfi_flash.c b/drivers/nor/cfi_flash.c
index 461b0e6..009e626 100644
--- a/drivers/nor/cfi_flash.c
+++ b/drivers/nor/cfi_flash.c
@@ -1017,7 +1017,7 @@ static struct driver_d cfi_driver = {
static int cfi_init(void)
{
- return register_driver(&cfi_driver);
+ return platform_driver_register(&cfi_driver);
}
device_initcall(cfi_init);
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 2b6d5d3..c5252dd 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -190,7 +190,7 @@ static struct driver_d pl011_driver = {
static int pl011_init(void)
{
- register_driver(&pl011_driver);
+ platform_driver_register(&pl011_driver);
return 0;
}
diff --git a/drivers/serial/arm_dcc.c b/drivers/serial/arm_dcc.c
index e1066ab..100468d 100644
--- a/drivers/serial/arm_dcc.c
+++ b/drivers/serial/arm_dcc.c
@@ -161,8 +161,8 @@ static struct device_d arm_dcc_device = {
static int arm_dcc_init(void)
{
- register_device(&arm_dcc_device);
- register_driver(&arm_dcc_driver);
+ platform_device_register(&arm_dcc_device);
+ platform_driver_register(&arm_dcc_driver);
return 0;
}
diff --git a/drivers/serial/atmel.c b/drivers/serial/atmel.c
index 2d4b842..120a985 100644
--- a/drivers/serial/atmel.c
+++ b/drivers/serial/atmel.c
@@ -425,7 +425,7 @@ static struct driver_d atmel_serial_driver = {
static int atmel_serial_init(void)
{
- register_driver(&atmel_serial_driver);
+ platform_driver_register(&atmel_serial_driver);
return 0;
}
diff --git a/drivers/serial/linux_console.c b/drivers/serial/linux_console.c
index c792b50..d9b7639 100644
--- a/drivers/serial/linux_console.c
+++ b/drivers/serial/linux_console.c
@@ -85,7 +85,7 @@ static struct driver_d linux_console_driver = {
static int console_init(void)
{
- return register_driver(&linux_console_driver);
+ return platform_driver_register(&linux_console_driver);
}
console_initcall(console_init);
diff --git a/drivers/serial/serial_altera.c b/drivers/serial/serial_altera.c
index 1148564..2fc9b8c 100644
--- a/drivers/serial/serial_altera.c
+++ b/drivers/serial/serial_altera.c
@@ -109,7 +109,7 @@ static struct driver_d altera_serial_driver = {
static int altera_serial_init(void)
{
- return register_driver(&altera_serial_driver);
+ return platform_driver_register(&altera_serial_driver);
}
console_initcall(altera_serial_init);
diff --git a/drivers/serial/serial_altera_jtag.c b/drivers/serial/serial_altera_jtag.c
index 2e34c89..26d5423 100644
--- a/drivers/serial/serial_altera_jtag.c
+++ b/drivers/serial/serial_altera_jtag.c
@@ -114,7 +114,7 @@ static struct driver_d altera_serial_jtag_driver = {
static int altera_serial_jtag_init(void)
{
- return register_driver(&altera_serial_jtag_driver);
+ return platform_driver_register(&altera_serial_jtag_driver);
}
console_initcall(altera_serial_jtag_init);
diff --git a/drivers/serial/serial_blackfin.c b/drivers/serial/serial_blackfin.c
index 59b2fbb..01dc1a1 100644
--- a/drivers/serial/serial_blackfin.c
+++ b/drivers/serial/serial_blackfin.c
@@ -138,7 +138,7 @@ static struct driver_d blackfin_serial_driver = {
static int blackfin_serial_init(void)
{
- register_driver(&blackfin_serial_driver);
+ platform_driver_register(&blackfin_serial_driver);
return 0;
}
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
index e3edac9..5415007 100644
--- a/drivers/serial/serial_imx.c
+++ b/drivers/serial/serial_imx.c
@@ -363,7 +363,7 @@ static struct driver_d imx_serial_driver = {
static int imx_serial_init(void)
{
- register_driver(&imx_serial_driver);
+ platform_driver_register(&imx_serial_driver);
return 0;
}
diff --git a/drivers/serial/serial_mpc5xxx.c b/drivers/serial/serial_mpc5xxx.c
index fb580cf..5e15345 100644
--- a/drivers/serial/serial_mpc5xxx.c
+++ b/drivers/serial/serial_mpc5xxx.c
@@ -175,7 +175,7 @@ static struct driver_d mpc5xxx_serial_driver = {
static int mpc5xxx_serial_register(void)
{
- register_driver(&mpc5xxx_serial_driver);
+ platform_driver_register(&mpc5xxx_serial_driver);
return 0;
}
diff --git a/drivers/serial/serial_netx.c b/drivers/serial/serial_netx.c
index fbbc4ef..ca72de7 100644
--- a/drivers/serial/serial_netx.c
+++ b/drivers/serial/serial_netx.c
@@ -164,7 +164,7 @@ static struct driver_d netx_serial_driver = {
static int netx_serial_init(void)
{
- register_driver(&netx_serial_driver);
+ platform_driver_register(&netx_serial_driver);
return 0;
}
diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
index 36d39cd..5252518 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -270,11 +270,11 @@ static struct driver_d ns16550_serial_driver = {
/**
* @brief driver initialization function
*
- * @return result of register_driver
+ * @return result of platform_driver_register
*/
static int ns16550_serial_init(void)
{
- return register_driver(&ns16550_serial_driver);
+ return platform_driver_register(&ns16550_serial_driver);
}
console_initcall(ns16550_serial_init);
diff --git a/drivers/serial/serial_pl010.c b/drivers/serial/serial_pl010.c
index 9f7b7d3..6dc2bd3 100644
--- a/drivers/serial/serial_pl010.c
+++ b/drivers/serial/serial_pl010.c
@@ -165,7 +165,7 @@ static struct driver_d pl010_driver = {
static int pl010_init(void)
{
- register_driver(&pl010_driver);
+ platform_driver_register(&pl010_driver);
return 0;
}
diff --git a/drivers/serial/serial_s3c24x0.c b/drivers/serial/serial_s3c24x0.c
index 21bca12..cf45f76 100644
--- a/drivers/serial/serial_s3c24x0.c
+++ b/drivers/serial/serial_s3c24x0.c
@@ -163,7 +163,7 @@ static struct driver_d s3c24x0_serial_driver = {
static int s3c24x0_serial_init(void)
{
- register_driver(&s3c24x0_serial_driver);
+ platform_driver_register(&s3c24x0_serial_driver);
return 0;
}
diff --git a/drivers/serial/stm-serial.c b/drivers/serial/stm-serial.c
index 4264345..e992ea1 100644
--- a/drivers/serial/stm-serial.c
+++ b/drivers/serial/stm-serial.c
@@ -190,7 +190,7 @@ static struct driver_d stm_serial_driver = {
static int stm_serial_init(void)
{
- register_driver(&stm_serial_driver);
+ platform_driver_register(&stm_serial_driver);
return 0;
}
diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c
index 0e2ea7e..3eb6455 100644
--- a/drivers/spi/imx_spi.c
+++ b/drivers/spi/imx_spi.c
@@ -356,7 +356,7 @@ static struct driver_d imx_spi_driver = {
static int imx_spi_init(void)
{
- register_driver(&imx_spi_driver);
+ platform_driver_register(&imx_spi_driver);
return 0;
}
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index b561f9d..d77162c 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -80,7 +80,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
strcpy(proxy->dev.name, chip->name);
proxy->dev.type_data = proxy;
dev_add_child(master->dev, &proxy->dev);
- status = register_device(&proxy->dev);
+ status = platform_device_register(&proxy->dev);
/* drivers may modify this initial i/o setup */
status = master->setup(proxy);
@@ -93,7 +93,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
return proxy;
fail:
- unregister_device(&proxy->dev);
+ platform_device_unregister(&proxy->dev);
free(proxy);
return NULL;
}
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index b01a797..271ee9f 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -427,7 +427,7 @@ static int usb_new_device(struct usb_device *dev)
print_usb_device(dev);
- register_device(&dev->dev);
+ platform_device_register(&dev->dev);
list_add_tail(&dev->list, &usb_device_list);
return 0;
@@ -457,7 +457,7 @@ void usb_rescan(void)
list_for_each_entry_safe(dev, tmp, &usb_device_list, list) {
list_del(&dev->list);
- unregister_device(&dev->dev);
+ platform_device_unregister(&dev->dev);
if (dev->hub)
free(dev->hub);
free(dev);
@@ -1273,7 +1273,7 @@ static int usb_hub_probe(struct usb_device *dev, int ifnum)
int usb_driver_register(struct usb_driver *drv)
{
drv->driver.bus = &usb_bus_type;
- return register_driver(&drv->driver);
+ return platform_driver_register(&drv->driver);
}
/* returns 0 if no match, 1 if match */
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index fd70e62..b21e87e 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1004,7 +1004,7 @@ int usb_composite_register(struct usb_composite_driver *driver)
composite_driver.function = (char *) driver->name;
composite = driver;
- return usb_gadget_register_driver(&composite_driver);
+ return usb_gadget_platform_driver_register(&composite_driver);
}
/**
@@ -1018,5 +1018,5 @@ void usb_composite_unregister(struct usb_composite_driver *driver)
{
if (composite != driver)
return;
- usb_gadget_unregister_driver(&composite_driver);
+ usb_gadget_unplatform_driver_register(&composite_driver);
}
diff --git a/drivers/usb/gadget/fsl_udc.c b/drivers/usb/gadget/fsl_udc.c
index 1e4d4b0..2a512b8 100644
--- a/drivers/usb/gadget/fsl_udc.c
+++ b/drivers/usb/gadget/fsl_udc.c
@@ -1977,7 +1977,7 @@ int usb_gadget_poll(void)
* Hook to gadget drivers
* Called by initialization code of gadget drivers
*----------------------------------------------------------------*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_platform_driver_register(struct usb_gadget_driver *driver)
{
int retval = -ENODEV;
@@ -2016,10 +2016,10 @@ out:
retval);
return retval;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_platform_driver_register);
/* Disconnect from gadget driver */
-int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
+int usb_gadget_unplatform_driver_register(struct usb_gadget_driver *driver)
{
struct fsl_ep *loop_ep;
@@ -2053,7 +2053,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
return 0;
}
-EXPORT_SYMBOL(usb_gadget_unregister_driver);
+EXPORT_SYMBOL(usb_gadget_unplatform_driver_register);
static int struct_udc_setup(struct fsl_udc *udc,
struct device_d *dev)
@@ -2305,7 +2305,7 @@ static struct driver_d fsl_udc_driver = {
static int fsl_udc_init(void)
{
- register_driver(&fsl_udc_driver);
+ platform_driver_register(&fsl_udc_driver);
return 0;
}
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 60fc181..5e027d2 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -950,7 +950,7 @@ static struct driver_d ehci_driver = {
static int ehcil_init(void)
{
- register_driver(&ehci_driver);
+ platform_driver_register(&ehci_driver);
return 0;
}
diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index 0be465f..6ce10d1 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -125,7 +125,7 @@ int register_framebuffer(struct fb_info *info)
sprintf(dev->name, "fb");
- register_device(&info->dev);
+ platform_device_register(&info->dev);
dev_add_param(dev, "enable", fb_enable_set, NULL, 0);
dev_set_param(dev, "enable", "0");
@@ -173,7 +173,7 @@ static struct driver_d fb_driver = {
static int fb_init_driver(void)
{
- register_driver(&fb_driver);
+ platform_driver_register(&fb_driver);
return 0;
}
device_initcall(fb_init_driver);
diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index 5ae8c4b..c4f1227 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -903,7 +903,7 @@ static struct driver_d imx3fb_driver = {
static int imx3fb_init(void)
{
- return register_driver(&imx3fb_driver);
+ return platform_driver_register(&imx3fb_driver);
}
device_initcall(imx3fb_init);
diff --git a/drivers/video/imx.c b/drivers/video/imx.c
index c19e83e..6c8bd73 100644
--- a/drivers/video/imx.c
+++ b/drivers/video/imx.c
@@ -594,7 +594,7 @@ static struct driver_d imxfb_driver = {
static int imxfb_init(void)
{
- return register_driver(&imxfb_driver);
+ return platform_driver_register(&imxfb_driver);
}
device_initcall(imxfb_init);
diff --git a/drivers/video/s3c.c b/drivers/video/s3c.c
index d079fde..7eb7533 100644
--- a/drivers/video/s3c.c
+++ b/drivers/video/s3c.c
@@ -415,7 +415,7 @@ static struct driver_d s3cfb_driver = {
static int s3cfb_init(void)
{
- return register_driver(&s3cfb_driver);
+ return platform_driver_register(&s3cfb_driver);
}
device_initcall(s3cfb_init);
diff --git a/drivers/video/stm.c b/drivers/video/stm.c
index 78acad7..b9205bc 100644
--- a/drivers/video/stm.c
+++ b/drivers/video/stm.c
@@ -519,7 +519,7 @@ static struct driver_d stmfb_driver = {
static int stmfb_init(void)
{
- return register_driver(&stmfb_driver);
+ return platform_driver_register(&stmfb_driver);
}
device_initcall(stmfb_init);
diff --git a/fs/fs.c b/fs/fs.c
index 7d65ec8..b4900a2 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -716,7 +716,7 @@ static LIST_HEAD(fs_driver_list);
int register_fs_driver(struct fs_driver_d *fsdrv)
{
list_add_tail(&fsdrv->list, &fs_driver_list);
- register_driver(&fsdrv->drv);
+ platform_driver_register(&fsdrv->drv);
return 0;
}
EXPORT_SYMBOL(register_fs_driver);
@@ -787,7 +787,7 @@ int mount(const char *device, const char *fsname, const char *_path)
fsdev->dev.type_data = fsdev;
fsdev->dev.id = get_free_deviceid(fsdev->dev.name);
- if ((ret = register_device(&fsdev->dev))) {
+ if ((ret = platform_device_register(&fsdev->dev))) {
errno = ret;
goto out1;
}
@@ -824,7 +824,7 @@ int mount(const char *device, const char *fsname, const char *_path)
return 0;
out2:
- unregister_device(&fsdev->dev);
+ platform_device_unregister(&fsdev->dev);
out1:
if (fsdev->backingstore)
free(fsdev->backingstore);
@@ -859,7 +859,7 @@ int umount(const char *pathname)
else
last->next = entry->next;
- unregister_device(entry->dev);
+ platform_device_unregister(entry->dev);
fsdev = entry->dev->type_data;
free(fsdev->backingstore);
free(fsdev);
diff --git a/include/driver.h b/include/driver.h
index c122cf2..c3da162 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -143,6 +143,14 @@ int register_device(struct device_d *);
*/
int unregister_device(struct device_d *);
+int platform_driver_register(struct driver_d *);
+int platform_device_register(struct device_d *);
+
+static inline int platform_device_unregister(struct device_d *dev)
+{
+ return unregister_device(dev);
+}
+
/* Organize devices in a tree. These functions do _not_ register or
* unregister a device. Only registered devices are allowed here.
*/
diff --git a/net/eth.c b/net/eth.c
index 406a4e6..0527c91 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -203,7 +203,7 @@ int eth_register(struct eth_device *edev)
if (edev->parent)
dev_add_child(edev->parent, &edev->dev);
- register_device(&edev->dev);
+ platform_device_register(&edev->dev);
dev->type_data = edev;
dev_add_param(dev, "ipaddr", eth_set_ipaddr, NULL, 0);
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 19+ messages in thread