[ARM] pxa: move device registration into CPU-specific file

This allows individual CPU support to determine which platform
devices should be registered.  Also fix a copy-n-paste bug in
the I2C power platform device entry.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Russell King
2007-05-15 10:39:49 +01:00
committed by Russell King
parent 4adb70fc1b
commit 34f3231f43
4 changed files with 83 additions and 76 deletions

View File

@@ -19,6 +19,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <asm/hardware.h>
@@ -136,6 +137,19 @@ void __init pxa25x_init_irq(void)
pxa_init_irq_gpio(85);
}
static struct platform_device *pxa25x_devices[] __initdata = {
&pxamci_device,
&pxaudc_device,
&pxafb_device,
&ffuart_device,
&btuart_device,
&stuart_device,
&pxai2c_device,
&pxai2s_device,
&pxaficp_device,
&pxartc_device,
};
static int __init pxa25x_init(void)
{
int ret = 0;
@@ -146,8 +160,14 @@ static int __init pxa25x_init(void)
#ifdef CONFIG_PM
pm_set_ops(&pxa25x_pm_ops);
#endif
ret = platform_add_devices(pxa25x_devices,
ARRAY_SIZE(pxa25x_devices));
}
return 0;
/* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */
if (cpu_is_pxa25x())
ret = platform_device_register(&hwuart_device);
return ret;
}
subsys_initcall(pxa25x_init);