diff options
Diffstat (limited to 'arch/arm/mach-pxa/generic.c')
-rw-r--r-- | arch/arm/mach-pxa/generic.c | 20 |
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 | ||
238 | void __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 | |||
238 | static struct resource pxamci_resources[] = { | 250 | static 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 | ||
264 | void __init pxa_set_mci_info(struct pxamci_platform_data *info) | 276 | void __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 | ||
329 | void __init set_pxa_fb_info(struct pxafb_mach_info *info) | 341 | void __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 | ||
334 | void __init set_pxa_fb_parent(struct device *parent_dev) | 346 | void __init set_pxa_fb_parent(struct device *parent_dev) |
@@ -433,7 +445,7 @@ struct platform_device pxa_device_i2c = { | |||
433 | 445 | ||
434 | void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) | 446 | void __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 | ||
439 | static struct resource pxai2s_resources[] = { | 451 | static struct resource pxai2s_resources[] = { |
@@ -468,7 +480,7 @@ struct platform_device pxa_device_ficp = { | |||
468 | 480 | ||
469 | void __init pxa_set_ficp_info(struct pxaficp_platform_data *info) | 481 | void __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 | ||
474 | struct platform_device pxa_device_rtc = { | 486 | struct platform_device pxa_device_rtc = { |