aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/mcbsp.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-07-21 16:48:45 -0400
committerKevin Hilman <khilman@ti.com>2011-09-15 19:35:46 -0400
commit3528c58eb9e818b7821501afa2916eb12131994a (patch)
tree078de60ef5e54b7028220c5cc58c93fe84d8e6b6 /arch/arm/mach-omap2/mcbsp.c
parenta2a28ad9969616fa6d7b243ecf334dc6983992cf (diff)
OMAP: omap_device: when building return platform_device instead of omap_device
All of the device init and device driver interaction with omap_device is done using platform_device pointers. To make this more explicit, have omap_device return a platform_device pointer instead of an omap_device pointer. All current users of the omap_device pointer were only using it to get at the platform_device pointer or struct device pointer, so fixing all of the users was trivial. This also makes it more difficult for device init code to directly access members of struct omap_device, and allows for easier changing of omap_device internals. Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/mcbsp.c')
-rw-r--r--arch/arm/mach-omap2/mcbsp.c8
1 files changed, 4 insertions, 4 deletions
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;