aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/devices.c44
-rw-r--r--arch/arm/mach-omap2/display.c6
-rw-r--r--arch/arm/mach-omap2/dma.c16
-rw-r--r--arch/arm/mach-omap2/gpio.c8
-rw-r--r--arch/arm/mach-omap2/hsmmc.c8
-rw-r--r--arch/arm/mach-omap2/hwspinlock.c8
-rw-r--r--arch/arm/mach-omap2/mcbsp.c8
-rw-r--r--arch/arm/mach-omap2/pm.c8
-rw-r--r--arch/arm/mach-omap2/serial.c12
-rw-r--r--arch/arm/mach-omap2/sr_device.c6
-rw-r--r--arch/arm/plat-omap/i2c.c8
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h4
-rw-r--r--arch/arm/plat-omap/omap_device.c6
13 files changed, 71 insertions, 71 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 1077ad663f93..10adf66be7ba 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -44,7 +44,7 @@ static int __init omap3_l3_init(void)
44{ 44{
45 int l; 45 int l;
46 struct omap_hwmod *oh; 46 struct omap_hwmod *oh;
47 struct omap_device *od; 47 struct platform_device *pdev;
48 char oh_name[L3_MODULES_MAX_LEN]; 48 char oh_name[L3_MODULES_MAX_LEN];
49 49
50 /* 50 /*
@@ -61,12 +61,12 @@ static int __init omap3_l3_init(void)
61 if (!oh) 61 if (!oh)
62 pr_err("could not look up %s\n", oh_name); 62 pr_err("could not look up %s\n", oh_name);
63 63
64 od = omap_device_build("omap_l3_smx", 0, oh, NULL, 0, 64 pdev = omap_device_build("omap_l3_smx", 0, oh, NULL, 0,
65 NULL, 0, 0); 65 NULL, 0, 0);
66 66
67 WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name); 67 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
68 68
69 return IS_ERR(od) ? PTR_ERR(od) : 0; 69 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
70} 70}
71postcore_initcall(omap3_l3_init); 71postcore_initcall(omap3_l3_init);
72 72
@@ -74,7 +74,7 @@ static int __init omap4_l3_init(void)
74{ 74{
75 int l, i; 75 int l, i;
76 struct omap_hwmod *oh[3]; 76 struct omap_hwmod *oh[3];
77 struct omap_device *od; 77 struct platform_device *pdev;
78 char oh_name[L3_MODULES_MAX_LEN]; 78 char oh_name[L3_MODULES_MAX_LEN];
79 79
80 /* 80 /*
@@ -92,12 +92,12 @@ static int __init omap4_l3_init(void)
92 pr_err("could not look up %s\n", oh_name); 92 pr_err("could not look up %s\n", oh_name);
93 } 93 }
94 94
95 od = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL, 95 pdev = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL,
96 0, NULL, 0, 0); 96 0, NULL, 0, 0);
97 97
98 WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name); 98 WARN(IS_ERR(pdev), "could not build omap_device for %s\n", oh_name);
99 99
100 return IS_ERR(od) ? PTR_ERR(od) : 0; 100 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
101} 101}
102postcore_initcall(omap4_l3_init); 102postcore_initcall(omap4_l3_init);
103 103
@@ -232,7 +232,7 @@ struct omap_device_pm_latency omap_keyboard_latency[] = {
232int __init omap4_keyboard_init(struct omap4_keypad_platform_data 232int __init omap4_keyboard_init(struct omap4_keypad_platform_data
233 *sdp4430_keypad_data, struct omap_board_data *bdata) 233 *sdp4430_keypad_data, struct omap_board_data *bdata)
234{ 234{
235 struct omap_device *od; 235 struct platform_device *pdev;
236 struct omap_hwmod *oh; 236 struct omap_hwmod *oh;
237 struct omap4_keypad_platform_data *keypad_data; 237 struct omap4_keypad_platform_data *keypad_data;
238 unsigned int id = -1; 238 unsigned int id = -1;
@@ -247,15 +247,15 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
247 247
248 keypad_data = sdp4430_keypad_data; 248 keypad_data = sdp4430_keypad_data;
249 249
250 od = omap_device_build(name, id, oh, keypad_data, 250 pdev = omap_device_build(name, id, oh, keypad_data,
251 sizeof(struct omap4_keypad_platform_data), 251 sizeof(struct omap4_keypad_platform_data),
252 omap_keyboard_latency, 252 omap_keyboard_latency,
253 ARRAY_SIZE(omap_keyboard_latency), 0); 253 ARRAY_SIZE(omap_keyboard_latency), 0);
254 254
255 if (IS_ERR(od)) { 255 if (IS_ERR(pdev)) {
256 WARN(1, "Can't build omap_device for %s:%s.\n", 256 WARN(1, "Can't build omap_device for %s:%s.\n",
257 name, oh->name); 257 name, oh->name);
258 return PTR_ERR(od); 258 return PTR_ERR(pdev);
259 } 259 }
260 oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); 260 oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
261 261
@@ -274,7 +274,7 @@ static struct omap_device_pm_latency mbox_latencies[] = {
274static inline void omap_init_mbox(void) 274static inline void omap_init_mbox(void)
275{ 275{
276 struct omap_hwmod *oh; 276 struct omap_hwmod *oh;
277 struct omap_device *od; 277 struct platform_device *pdev;
278 278
279 oh = omap_hwmod_lookup("mailbox"); 279 oh = omap_hwmod_lookup("mailbox");
280 if (!oh) { 280 if (!oh) {
@@ -282,10 +282,10 @@ static inline void omap_init_mbox(void)
282 return; 282 return;
283 } 283 }
284 284
285 od = omap_device_build("omap-mailbox", -1, oh, NULL, 0, 285 pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0,
286 mbox_latencies, ARRAY_SIZE(mbox_latencies), 0); 286 mbox_latencies, ARRAY_SIZE(mbox_latencies), 0);
287 WARN(IS_ERR(od), "%s: could not build device, err %ld\n", 287 WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
288 __func__, PTR_ERR(od)); 288 __func__, PTR_ERR(pdev));
289} 289}
290#else 290#else
291static inline void omap_init_mbox(void) { } 291static inline void omap_init_mbox(void) { }
@@ -344,7 +344,7 @@ struct omap_device_pm_latency omap_mcspi_latency[] = {
344 344
345static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) 345static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
346{ 346{
347 struct omap_device *od; 347 struct platform_device *pdev;
348 char *name = "omap2_mcspi"; 348 char *name = "omap2_mcspi";
349 struct omap2_mcspi_platform_config *pdata; 349 struct omap2_mcspi_platform_config *pdata;
350 static int spi_num; 350 static int spi_num;
@@ -371,10 +371,10 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
371 } 371 }
372 372
373 spi_num++; 373 spi_num++;
374 od = omap_device_build(name, spi_num, oh, pdata, 374 pdev = omap_device_build(name, spi_num, oh, pdata,
375 sizeof(*pdata), omap_mcspi_latency, 375 sizeof(*pdata), omap_mcspi_latency,
376 ARRAY_SIZE(omap_mcspi_latency), 0); 376 ARRAY_SIZE(omap_mcspi_latency), 0);
377 WARN(IS_ERR(od), "Can't build omap_device for %s:%s\n", 377 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n",
378 name, oh->name); 378 name, oh->name);
379 kfree(pdata); 379 kfree(pdata);
380 return 0; 380 return 0;
@@ -709,7 +709,7 @@ static struct omap_device_pm_latency omap_wdt_latency[] = {
709static int __init omap_init_wdt(void) 709static int __init omap_init_wdt(void)
710{ 710{
711 int id = -1; 711 int id = -1;
712 struct omap_device *od; 712 struct platform_device *pdev;
713 struct omap_hwmod *oh; 713 struct omap_hwmod *oh;
714 char *oh_name = "wd_timer2"; 714 char *oh_name = "wd_timer2";
715 char *dev_name = "omap_wdt"; 715 char *dev_name = "omap_wdt";
@@ -723,10 +723,10 @@ static int __init omap_init_wdt(void)
723 return -EINVAL; 723 return -EINVAL;
724 } 724 }
725 725
726 od = omap_device_build(dev_name, id, oh, NULL, 0, 726 pdev = omap_device_build(dev_name, id, oh, NULL, 0,
727 omap_wdt_latency, 727 omap_wdt_latency,
728 ARRAY_SIZE(omap_wdt_latency), 0); 728 ARRAY_SIZE(omap_wdt_latency), 0);
729 WARN(IS_ERR(od), "Can't build omap_device for %s:%s.\n", 729 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
730 dev_name, oh->name); 730 dev_name, oh->name);
731 return 0; 731 return 0;
732} 732}
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index a5b7a236aa5b..18693f6de041 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -78,7 +78,7 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
78{ 78{
79 int r = 0; 79 int r = 0;
80 struct omap_hwmod *oh; 80 struct omap_hwmod *oh;
81 struct omap_device *od; 81 struct platform_device *pdev;
82 int i, oh_count; 82 int i, oh_count;
83 struct omap_display_platform_data pdata; 83 struct omap_display_platform_data pdata;
84 const struct omap_dss_hwmod_data *curr_dss_hwmod; 84 const struct omap_dss_hwmod_data *curr_dss_hwmod;
@@ -108,13 +108,13 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
108 return -ENODEV; 108 return -ENODEV;
109 } 109 }
110 110
111 od = omap_device_build(curr_dss_hwmod[i].dev_name, 111 pdev = omap_device_build(curr_dss_hwmod[i].dev_name,
112 curr_dss_hwmod[i].id, oh, &pdata, 112 curr_dss_hwmod[i].id, oh, &pdata,
113 sizeof(struct omap_display_platform_data), 113 sizeof(struct omap_display_platform_data),
114 omap_dss_latency, 114 omap_dss_latency,
115 ARRAY_SIZE(omap_dss_latency), 0); 115 ARRAY_SIZE(omap_dss_latency), 0);
116 116
117 if (WARN((IS_ERR(od)), "Could not build omap_device for %s\n", 117 if (WARN((IS_ERR(pdev)), "Could not build omap_device for %s\n",
118 curr_dss_hwmod[i].oh_name)) 118 curr_dss_hwmod[i].oh_name))
119 return -ENODEV; 119 return -ENODEV;
120 } 120 }
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index c9ff0e79703d..ae8cb3fb1830 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -228,7 +228,7 @@ static u32 configure_dma_errata(void)
228/* One time initializations */ 228/* One time initializations */
229static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused) 229static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
230{ 230{
231 struct omap_device *od; 231 struct platform_device *pdev;
232 struct omap_system_dma_plat_info *p; 232 struct omap_system_dma_plat_info *p;
233 struct resource *mem; 233 struct resource *mem;
234 char *name = "omap_dma_system"; 234 char *name = "omap_dma_system";
@@ -258,23 +258,23 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
258 258
259 p->errata = configure_dma_errata(); 259 p->errata = configure_dma_errata();
260 260
261 od = omap_device_build(name, 0, oh, p, sizeof(*p), 261 pdev = omap_device_build(name, 0, oh, p, sizeof(*p),
262 omap2_dma_latency, ARRAY_SIZE(omap2_dma_latency), 0); 262 omap2_dma_latency, ARRAY_SIZE(omap2_dma_latency), 0);
263 kfree(p); 263 kfree(p);
264 if (IS_ERR(od)) { 264 if (IS_ERR(pdev)) {
265 pr_err("%s: Can't build omap_device for %s:%s.\n", 265 pr_err("%s: Can't build omap_device for %s:%s.\n",
266 __func__, name, oh->name); 266 __func__, name, oh->name);
267 return PTR_ERR(od); 267 return PTR_ERR(pdev);
268 } 268 }
269 269
270 mem = platform_get_resource(&od->pdev, IORESOURCE_MEM, 0); 270 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
271 if (!mem) { 271 if (!mem) {
272 dev_err(&od->pdev.dev, "%s: no mem resource\n", __func__); 272 dev_err(&pdev->dev, "%s: no mem resource\n", __func__);
273 return -EINVAL; 273 return -EINVAL;
274 } 274 }
275 dma_base = ioremap(mem->start, resource_size(mem)); 275 dma_base = ioremap(mem->start, resource_size(mem));
276 if (!dma_base) { 276 if (!dma_base) {
277 dev_err(&od->pdev.dev, "%s: ioremap fail\n", __func__); 277 dev_err(&pdev->dev, "%s: ioremap fail\n", __func__);
278 return -ENOMEM; 278 return -ENOMEM;
279 } 279 }
280 280
@@ -283,7 +283,7 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
283 (d->lch_count), GFP_KERNEL); 283 (d->lch_count), GFP_KERNEL);
284 284
285 if (!d->chan) { 285 if (!d->chan) {
286 dev_err(&od->pdev.dev, "%s: kzalloc fail\n", __func__); 286 dev_err(&pdev->dev, "%s: kzalloc fail\n", __func__);
287 return -ENOMEM; 287 return -ENOMEM;
288 } 288 }
289 return 0; 289 return 0;
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 2765cdc3152d..76abdcb6e0b0 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -34,7 +34,7 @@ static struct omap_device_pm_latency omap_gpio_latency[] = {
34 34
35static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) 35static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
36{ 36{
37 struct omap_device *od; 37 struct platform_device *pdev;
38 struct omap_gpio_platform_data *pdata; 38 struct omap_gpio_platform_data *pdata;
39 struct omap_gpio_dev_attr *dev_attr; 39 struct omap_gpio_dev_attr *dev_attr;
40 char *name = "omap_gpio"; 40 char *name = "omap_gpio";
@@ -107,16 +107,16 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
107 return -EINVAL; 107 return -EINVAL;
108 } 108 }
109 109
110 od = omap_device_build(name, id - 1, oh, pdata, 110 pdev = omap_device_build(name, id - 1, oh, pdata,
111 sizeof(*pdata), omap_gpio_latency, 111 sizeof(*pdata), omap_gpio_latency,
112 ARRAY_SIZE(omap_gpio_latency), 112 ARRAY_SIZE(omap_gpio_latency),
113 false); 113 false);
114 kfree(pdata); 114 kfree(pdata);
115 115
116 if (IS_ERR(od)) { 116 if (IS_ERR(pdev)) {
117 WARN(1, "Can't build omap_device for %s:%s.\n", 117 WARN(1, "Can't build omap_device for %s:%s.\n",
118 name, oh->name); 118 name, oh->name);
119 return PTR_ERR(od); 119 return PTR_ERR(pdev);
120 } 120 }
121 121
122 omap_device_disable_idle_on_suspend(od); 122 omap_device_disable_idle_on_suspend(od);
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index a9b45c76e1d3..cc8791952a05 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -430,7 +430,7 @@ static struct omap_device_pm_latency omap_hsmmc_latency[] = {
430void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr) 430void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
431{ 431{
432 struct omap_hwmod *oh; 432 struct omap_hwmod *oh;
433 struct omap_device *od; 433 struct platform_device *pdev;
434 struct omap_device_pm_latency *ohl; 434 struct omap_device_pm_latency *ohl;
435 char oh_name[MAX_OMAP_MMC_HWMOD_NAME_LEN]; 435 char oh_name[MAX_OMAP_MMC_HWMOD_NAME_LEN];
436 struct omap_mmc_platform_data *mmc_data; 436 struct omap_mmc_platform_data *mmc_data;
@@ -471,9 +471,9 @@ void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
471 mmc_data->controller_flags = mmc_dev_attr->flags; 471 mmc_data->controller_flags = mmc_dev_attr->flags;
472 } 472 }
473 473
474 od = omap_device_build(name, ctrl_nr - 1, oh, mmc_data, 474 pdev = omap_device_build(name, ctrl_nr - 1, oh, mmc_data,
475 sizeof(struct omap_mmc_platform_data), ohl, ohl_cnt, false); 475 sizeof(struct omap_mmc_platform_data), ohl, ohl_cnt, false);
476 if (IS_ERR(od)) { 476 if (IS_ERR(pdev)) {
477 WARN(1, "Can't build omap_device for %s:%s.\n", name, oh->name); 477 WARN(1, "Can't build omap_device for %s:%s.\n", name, oh->name);
478 kfree(mmc_data->slots[0].name); 478 kfree(mmc_data->slots[0].name);
479 goto done; 479 goto done;
@@ -482,7 +482,7 @@ void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
482 * return device handle to board setup code 482 * return device handle to board setup code
483 * required to populate for regulator framework structure 483 * required to populate for regulator framework structure
484 */ 484 */
485 hsmmcinfo->dev = &od->pdev.dev; 485 hsmmcinfo->dev = &pdev->dev;
486 486
487done: 487done:
488 kfree(mmc_data); 488 kfree(mmc_data);
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
index 06d4a80660a5..0b3ae9d9c3b3 100644
--- a/arch/arm/mach-omap2/hwspinlock.c
+++ b/arch/arm/mach-omap2/hwspinlock.c
@@ -35,7 +35,7 @@ int __init hwspinlocks_init(void)
35{ 35{
36 int retval = 0; 36 int retval = 0;
37 struct omap_hwmod *oh; 37 struct omap_hwmod *oh;
38 struct omap_device *od; 38 struct platform_device *pdev;
39 const char *oh_name = "spinlock"; 39 const char *oh_name = "spinlock";
40 const char *dev_name = "omap_hwspinlock"; 40 const char *dev_name = "omap_hwspinlock";
41 41
@@ -48,13 +48,13 @@ int __init hwspinlocks_init(void)
48 if (oh == NULL) 48 if (oh == NULL)
49 return -EINVAL; 49 return -EINVAL;
50 50
51 od = omap_device_build(dev_name, 0, oh, NULL, 0, 51 pdev = omap_device_build(dev_name, 0, oh, NULL, 0,
52 omap_spinlock_latency, 52 omap_spinlock_latency,
53 ARRAY_SIZE(omap_spinlock_latency), false); 53 ARRAY_SIZE(omap_spinlock_latency), false);
54 if (IS_ERR(od)) { 54 if (IS_ERR(pdev)) {
55 pr_err("Can't build omap_device for %s:%s\n", dev_name, 55 pr_err("Can't build omap_device for %s:%s\n", dev_name,
56 oh_name); 56 oh_name);
57 retval = PTR_ERR(od); 57 retval = PTR_ERR(pdev);
58 } 58 }
59 59
60 return retval; 60 return retval;
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 4a6ef6ab8458..7a42f32bd87d 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -116,7 +116,7 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
116 char *name = "omap-mcbsp"; 116 char *name = "omap-mcbsp";
117 struct omap_hwmod *oh_device[2]; 117 struct omap_hwmod *oh_device[2];
118 struct omap_mcbsp_platform_data *pdata = NULL; 118 struct omap_mcbsp_platform_data *pdata = NULL;
119 struct omap_device *od; 119 struct platform_device *pdev;
120 120
121 sscanf(oh->name, "mcbsp%d", &id); 121 sscanf(oh->name, "mcbsp%d", &id);
122 122
@@ -144,14 +144,14 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
144 (struct omap_mcbsp_dev_attr *)(oh->dev_attr))->sidetone); 144 (struct omap_mcbsp_dev_attr *)(oh->dev_attr))->sidetone);
145 count++; 145 count++;
146 } 146 }
147 od = omap_device_build_ss(name, id, oh_device, count, pdata, 147 pdev = omap_device_build_ss(name, id, oh_device, count, pdata,
148 sizeof(*pdata), omap2_mcbsp_latency, 148 sizeof(*pdata), omap2_mcbsp_latency,
149 ARRAY_SIZE(omap2_mcbsp_latency), false); 149 ARRAY_SIZE(omap2_mcbsp_latency), false);
150 kfree(pdata); 150 kfree(pdata);
151 if (IS_ERR(od)) { 151 if (IS_ERR(pdev)) {
152 pr_err("%s: Can't build omap_device for %s:%s.\n", __func__, 152 pr_err("%s: Can't build omap_device for %s:%s.\n", __func__,
153 name, oh->name); 153 name, oh->name);
154 return PTR_ERR(od); 154 return PTR_ERR(pdev);
155 } 155 }
156 omap_mcbsp_count++; 156 omap_mcbsp_count++;
157 return 0; 157 return 0;
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 472bf22d5e84..e7cd794ae43a 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -60,19 +60,19 @@ EXPORT_SYMBOL(omap4_get_dsp_device);
60static int _init_omap_device(char *name, struct device **new_dev) 60static int _init_omap_device(char *name, struct device **new_dev)
61{ 61{
62 struct omap_hwmod *oh; 62 struct omap_hwmod *oh;
63 struct omap_device *od; 63 struct platform_device *pdev;
64 64
65 oh = omap_hwmod_lookup(name); 65 oh = omap_hwmod_lookup(name);
66 if (WARN(!oh, "%s: could not find omap_hwmod for %s\n", 66 if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
67 __func__, name)) 67 __func__, name))
68 return -ENODEV; 68 return -ENODEV;
69 69
70 od = omap_device_build(oh->name, 0, oh, NULL, 0, pm_lats, 0, false); 70 pdev = omap_device_build(oh->name, 0, oh, NULL, 0, pm_lats, 0, false);
71 if (WARN(IS_ERR(od), "%s: could not build omap_device for %s\n", 71 if (WARN(IS_ERR(pdev), "%s: could not build omap_device for %s\n",
72 __func__, name)) 72 __func__, name))
73 return -ENODEV; 73 return -ENODEV;
74 74
75 *new_dev = &od->pdev.dev; 75 *new_dev = &pdev->dev;
76 76
77 return 0; 77 return 0;
78} 78}
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 466fc722fa0f..53b680878138 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -711,7 +711,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
711{ 711{
712 struct omap_uart_state *uart; 712 struct omap_uart_state *uart;
713 struct omap_hwmod *oh; 713 struct omap_hwmod *oh;
714 struct omap_device *od; 714 struct platform_device *pdev;
715 void *pdata = NULL; 715 void *pdata = NULL;
716 u32 pdata_size = 0; 716 u32 pdata_size = 0;
717 char *name; 717 char *name;
@@ -799,10 +799,10 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
799 if (WARN_ON(!oh)) 799 if (WARN_ON(!oh))
800 return; 800 return;
801 801
802 od = omap_device_build(name, uart->num, oh, pdata, pdata_size, 802 pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size,
803 omap_uart_latency, 803 omap_uart_latency,
804 ARRAY_SIZE(omap_uart_latency), false); 804 ARRAY_SIZE(omap_uart_latency), false);
805 WARN(IS_ERR(od), "Could not build omap_device for %s: %s.\n", 805 WARN(IS_ERR(pdev), "Could not build omap_device for %s: %s.\n",
806 name, oh->name); 806 name, oh->name);
807 807
808 omap_device_disable_idle_on_suspend(od); 808 omap_device_disable_idle_on_suspend(od);
@@ -812,7 +812,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
812 uart->regshift = 2; 812 uart->regshift = 2;
813 uart->mapbase = oh->slaves[0]->addr->pa_start; 813 uart->mapbase = oh->slaves[0]->addr->pa_start;
814 uart->membase = omap_hwmod_get_mpu_rt_va(oh); 814 uart->membase = omap_hwmod_get_mpu_rt_va(oh);
815 uart->pdev = &od->pdev; 815 uart->pdev = pdev;
816 816
817 oh->dev_attr = uart; 817 oh->dev_attr = uart;
818 818
@@ -846,8 +846,8 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
846 846
847 if ((cpu_is_omap34xx() && uart->padconf) || 847 if ((cpu_is_omap34xx() && uart->padconf) ||
848 (uart->wk_en && uart->wk_mask)) { 848 (uart->wk_en && uart->wk_mask)) {
849 device_init_wakeup(&od->pdev.dev, true); 849 device_init_wakeup(&pdev->dev, true);
850 DEV_CREATE_FILE(&od->pdev.dev, &dev_attr_sleep_timeout); 850 DEV_CREATE_FILE(&pdev->dev, &dev_attr_sleep_timeout);
851 } 851 }
852 852
853 /* Enable the MDR1 errata for OMAP3 */ 853 /* Enable the MDR1 errata for OMAP3 */
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index 10d3c5ee8018..624264d8e1a5 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -80,7 +80,7 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
80static int sr_dev_init(struct omap_hwmod *oh, void *user) 80static int sr_dev_init(struct omap_hwmod *oh, void *user)
81{ 81{
82 struct omap_sr_data *sr_data; 82 struct omap_sr_data *sr_data;
83 struct omap_device *od; 83 struct platform_device *pdev;
84 struct omap_volt_data *volt_data; 84 struct omap_volt_data *volt_data;
85 char *name = "smartreflex"; 85 char *name = "smartreflex";
86 static int i; 86 static int i;
@@ -120,10 +120,10 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
120 120
121 sr_data->enable_on_init = sr_enable_on_init; 121 sr_data->enable_on_init = sr_enable_on_init;
122 122
123 od = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data), 123 pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
124 omap_sr_latency, 124 omap_sr_latency,
125 ARRAY_SIZE(omap_sr_latency), 0); 125 ARRAY_SIZE(omap_sr_latency), 0);
126 if (IS_ERR(od)) 126 if (IS_ERR(pdev))
127 pr_warning("%s: Could not build omap_device for %s: %s.\n\n", 127 pr_warning("%s: Could not build omap_device for %s: %s.\n\n",
128 __func__, name, oh->name); 128 __func__, name, oh->name);
129exit: 129exit:
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index 3341ca4703e9..0c7caf2458b4 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -135,7 +135,7 @@ static inline int omap2_i2c_add_bus(int bus_id)
135{ 135{
136 int l; 136 int l;
137 struct omap_hwmod *oh; 137 struct omap_hwmod *oh;
138 struct omap_device *od; 138 struct platform_device *pdev;
139 char oh_name[MAX_OMAP_I2C_HWMOD_NAME_LEN]; 139 char oh_name[MAX_OMAP_I2C_HWMOD_NAME_LEN];
140 struct omap_i2c_bus_platform_data *pdata; 140 struct omap_i2c_bus_platform_data *pdata;
141 141
@@ -160,12 +160,12 @@ static inline int omap2_i2c_add_bus(int bus_id)
160 */ 160 */
161 if (cpu_is_omap34xx()) 161 if (cpu_is_omap34xx())
162 pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat; 162 pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat;
163 od = omap_device_build(name, bus_id, oh, pdata, 163 pdev = omap_device_build(name, bus_id, oh, pdata,
164 sizeof(struct omap_i2c_bus_platform_data), 164 sizeof(struct omap_i2c_bus_platform_data),
165 omap_i2c_latency, ARRAY_SIZE(omap_i2c_latency), 0); 165 omap_i2c_latency, ARRAY_SIZE(omap_i2c_latency), 0);
166 WARN(IS_ERR(od), "Could not build omap_device for %s\n", name); 166 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
167 167
168 return PTR_ERR(od); 168 return PTR_ERR(pdev);
169} 169}
170#else 170#else
171static inline int omap2_i2c_add_bus(int bus_id) 171static inline int omap2_i2c_add_bus(int bus_id)
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 61d14b385a91..750f401051d1 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -88,13 +88,13 @@ int omap_device_shutdown(struct platform_device *pdev);
88 88
89/* Core code interface */ 89/* Core code interface */
90 90
91struct omap_device *omap_device_build(const char *pdev_name, int pdev_id, 91struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
92 struct omap_hwmod *oh, void *pdata, 92 struct omap_hwmod *oh, void *pdata,
93 int pdata_len, 93 int pdata_len,
94 struct omap_device_pm_latency *pm_lats, 94 struct omap_device_pm_latency *pm_lats,
95 int pm_lats_cnt, int is_early_device); 95 int pm_lats_cnt, int is_early_device);
96 96
97struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id, 97struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
98 struct omap_hwmod **oh, int oh_cnt, 98 struct omap_hwmod **oh, int oh_cnt,
99 void *pdata, int pdata_len, 99 void *pdata, int pdata_len,
100 struct omap_device_pm_latency *pm_lats, 100 struct omap_device_pm_latency *pm_lats,
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index d3fdf5137e06..3e8a17bb6c09 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -405,7 +405,7 @@ static int omap_device_fill_resources(struct omap_device *od,
405 * information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise, 405 * information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
406 * passes along the return value of omap_device_build_ss(). 406 * passes along the return value of omap_device_build_ss().
407 */ 407 */
408struct omap_device *omap_device_build(const char *pdev_name, int pdev_id, 408struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
409 struct omap_hwmod *oh, void *pdata, 409 struct omap_hwmod *oh, void *pdata,
410 int pdata_len, 410 int pdata_len,
411 struct omap_device_pm_latency *pm_lats, 411 struct omap_device_pm_latency *pm_lats,
@@ -438,7 +438,7 @@ struct omap_device *omap_device_build(const char *pdev_name, int pdev_id,
438 * platform_device record. Returns an ERR_PTR() on error, or passes 438 * platform_device record. Returns an ERR_PTR() on error, or passes
439 * along the return value of omap_device_register(). 439 * along the return value of omap_device_register().
440 */ 440 */
441struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id, 441struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
442 struct omap_hwmod **ohs, int oh_cnt, 442 struct omap_hwmod **ohs, int oh_cnt,
443 void *pdata, int pdata_len, 443 void *pdata, int pdata_len,
444 struct omap_device_pm_latency *pm_lats, 444 struct omap_device_pm_latency *pm_lats,
@@ -513,7 +513,7 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
513 if (ret) 513 if (ret)
514 goto odbs_exit4; 514 goto odbs_exit4;
515 515
516 return od; 516 return &od->pdev;
517 517
518odbs_exit4: 518odbs_exit4:
519 kfree(res); 519 kfree(res);