summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dss.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-01-24 14:00:45 +0100
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-01-25 12:48:35 +0100
commit6e2a14d2c59f6208310eeb6b031e9d1c22b38c6a (patch)
tree8267f62f049f5cbd82800f9719ee550b74dc3821 /drivers/video/omap2/dss/dss.c
parentOMAPDSS: VENC: fix NULL pointer dereference in DSS2 VENC sysfs debug attr on ... (diff)
downloadlinux-6e2a14d2c59f6208310eeb6b031e9d1c22b38c6a.tar.xz
linux-6e2a14d2c59f6208310eeb6b031e9d1c22b38c6a.zip
OMAPDSS: use devm_ functions
The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dss.c')
-rw-r--r--drivers/video/omap2/dss/dss.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 17033457ee89..e75f837c766c 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -751,7 +751,8 @@ static int omap_dsshw_probe(struct platform_device *pdev)
r = -EINVAL;
goto err_ioremap;
}
- dss.base = ioremap(dss_mem->start, resource_size(dss_mem));
+ dss.base = devm_ioremap(&pdev->dev, dss_mem->start,
+ resource_size(dss_mem));
if (!dss.base) {
DSSERR("can't ioremap DSS\n");
r = -ENOMEM;
@@ -760,7 +761,7 @@ static int omap_dsshw_probe(struct platform_device *pdev)
r = dss_get_clocks();
if (r)
- goto err_clocks;
+ goto err_ioremap;
pm_runtime_enable(&pdev->dev);
@@ -808,8 +809,6 @@ err_dpi:
err_runtime_get:
pm_runtime_disable(&pdev->dev);
dss_put_clocks();
-err_clocks:
- iounmap(dss.base);
err_ioremap:
return r;
}
@@ -819,8 +818,6 @@ static int omap_dsshw_remove(struct platform_device *pdev)
dpi_exit();
sdi_exit();
- iounmap(dss.base);
-
pm_runtime_disable(&pdev->dev);
dss_put_clocks();