aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/dma.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/dma.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/dma.c')
-rw-r--r--arch/arm/mach-omap2/dma.c16
1 files changed, 8 insertions, 8 deletions
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;