aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2012-12-24 03:33:42 -0500
committerInki Dae <inki.dae@samsung.com>2013-01-04 01:54:34 -0500
commitbfb6ed26008b47c5b2b4df073a45627f31f12966 (patch)
tree4a9a570c657c4d3a4599bfaac8bda59c6113e269 /drivers
parent1dcfe2382af35ebd685668d96b4fccd953e75ffc (diff)
drm/exynos: Use devm_kzalloc in exynos_drm_ipp.c
devm_kzalloc makes the code simpler by eliminating the need for explicit freeing. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_ipp.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 63bcf92c47d0..e7a860fb7487 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -1890,7 +1890,7 @@ static int __devinit ipp_probe(struct platform_device *pdev)
1890 struct exynos_drm_subdrv *subdrv; 1890 struct exynos_drm_subdrv *subdrv;
1891 int ret; 1891 int ret;
1892 1892
1893 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); 1893 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
1894 if (!ctx) 1894 if (!ctx)
1895 return -ENOMEM; 1895 return -ENOMEM;
1896 1896
@@ -1911,8 +1911,7 @@ static int __devinit ipp_probe(struct platform_device *pdev)
1911 ctx->event_workq = create_singlethread_workqueue("ipp_event"); 1911 ctx->event_workq = create_singlethread_workqueue("ipp_event");
1912 if (!ctx->event_workq) { 1912 if (!ctx->event_workq) {
1913 dev_err(dev, "failed to create event workqueue\n"); 1913 dev_err(dev, "failed to create event workqueue\n");
1914 ret = -EINVAL; 1914 return -EINVAL;
1915 goto err_clear;
1916 } 1915 }
1917 1916
1918 /* 1917 /*
@@ -1953,8 +1952,6 @@ err_cmd_workq:
1953 destroy_workqueue(ctx->cmd_workq); 1952 destroy_workqueue(ctx->cmd_workq);
1954err_event_workq: 1953err_event_workq:
1955 destroy_workqueue(ctx->event_workq); 1954 destroy_workqueue(ctx->event_workq);
1956err_clear:
1957 kfree(ctx);
1958 return ret; 1955 return ret;
1959} 1956}
1960 1957
@@ -1980,8 +1977,6 @@ static int __devexit ipp_remove(struct platform_device *pdev)
1980 destroy_workqueue(ctx->cmd_workq); 1977 destroy_workqueue(ctx->cmd_workq);
1981 destroy_workqueue(ctx->event_workq); 1978 destroy_workqueue(ctx->event_workq);
1982 1979
1983 kfree(ctx);
1984
1985 return 0; 1980 return 0;
1986} 1981}
1987 1982