}
+void __init pxa_register_device(struct platform_device *dev, void *data)
+{
+ int ret;
+
+ dev->dev.platform_data = data;
+
+ ret = platform_device_register(dev);
+ if (ret)
+ dev_err(&dev->dev, "unable to register device: %d\n", ret);
+}
+
+
static struct resource pxamci_resources[] = {
[0] = {
.start = 0x41100000,
void __init pxa_set_mci_info(struct pxamci_platform_data *info)
{
- pxa_device_mci.dev.platform_data = info;
+ pxa_register_device(&pxa_device_mci, info);
}
void __init set_pxa_fb_info(struct pxafb_mach_info *info)
{
- pxa_device_fb.dev.platform_data = info;
+ pxa_register_device(&pxa_device_fb, info);
}
void __init set_pxa_fb_parent(struct device *parent_dev)
void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
{
- pxa_device_i2c.dev.platform_data = info;
+ pxa_register_device(&pxa_device_i2c, info);
}
static struct resource pxai2s_resources[] = {
void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
{
- pxa_device_ficp.dev.platform_data = info;
+ pxa_register_device(&pxa_device_ficp, info);
}
struct platform_device pxa_device_rtc = {
void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
{
- pxa27x_device_ohci.dev.platform_data = info;
+ pxa_register_device(&pxa27x_device_ohci, info);
}
static struct resource i2c_power_resources[] = {
};
static struct platform_device *devices[] __initdata = {
- &pxa_device_mci,
&pxa_device_udc,
- &pxa_device_fb,
&pxa_device_ffuart,
&pxa_device_btuart,
&pxa_device_stuart,
- &pxa_device_i2c,
&pxa_device_i2s,
- &pxa_device_ficp,
&pxa_device_rtc,
&pxa27x_device_i2c_power,
- &pxa27x_device_ohci,
};
static int __init pxa27x_init(void)