aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/generic.c')
-rw-r--r--arch/arm/mach-pxa/generic.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 1c34946ee16e..3d863c919e8b 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -235,6 +235,18 @@ void __init pxa_map_io(void)
235} 235}
236 236
237 237
238void __init pxa_register_device(struct platform_device *dev, void *data)
239{
240 int ret;
241
242 dev->dev.platform_data = data;
243
244 ret = platform_device_register(dev);
245 if (ret)
246 dev_err(&dev->dev, "unable to register device: %d\n", ret);
247}
248
249
238static struct resource pxamci_resources[] = { 250static struct resource pxamci_resources[] = {
239 [0] = { 251 [0] = {
240 .start = 0x41100000, 252 .start = 0x41100000,
@@ -263,7 +275,7 @@ struct platform_device pxa_device_mci = {
263 275
264void __init pxa_set_mci_info(struct pxamci_platform_data *info) 276void __init pxa_set_mci_info(struct pxamci_platform_data *info)
265{ 277{
266 pxa_device_mci.dev.platform_data = info; 278 pxa_register_device(&pxa_device_mci, info);
267} 279}
268 280
269 281
@@ -328,7 +340,7 @@ struct platform_device pxa_device_fb = {
328 340
329void __init set_pxa_fb_info(struct pxafb_mach_info *info) 341void __init set_pxa_fb_info(struct pxafb_mach_info *info)
330{ 342{
331 pxa_device_fb.dev.platform_data = info; 343 pxa_register_device(&pxa_device_fb, info);
332} 344}
333 345
334void __init set_pxa_fb_parent(struct device *parent_dev) 346void __init set_pxa_fb_parent(struct device *parent_dev)
@@ -433,7 +445,7 @@ struct platform_device pxa_device_i2c = {
433 445
434void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) 446void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
435{ 447{
436 pxa_device_i2c.dev.platform_data = info; 448 pxa_register_device(&pxa_device_i2c, info);
437} 449}
438 450
439static struct resource pxai2s_resources[] = { 451static struct resource pxai2s_resources[] = {
@@ -468,7 +480,7 @@ struct platform_device pxa_device_ficp = {
468 480
469void __init pxa_set_ficp_info(struct pxaficp_platform_data *info) 481void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
470{ 482{
471 pxa_device_ficp.dev.platform_data = info; 483 pxa_register_device(&pxa_device_ficp, info);
472} 484}
473 485
474struct platform_device pxa_device_rtc = { 486struct platform_device pxa_device_rtc = {