diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-12-24 14:03:42 +0530 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2013-01-04 15:54:34 +0900 |
commit | bfb6ed26008b47c5b2b4df073a45627f31f12966 (patch) | |
tree | 4a9a570c657c4d3a4599bfaac8bda59c6113e269 /drivers/gpu | |
parent | 1dcfe2382af35ebd685668d96b4fccd953e75ffc (diff) | |
download | linux-bfb6ed26008b47c5b2b4df073a45627f31f12966.tar.bz2 |
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/gpu')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.c | 9 |
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) struct exynos_drm_subdrv *subdrv; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -1911,8 +1911,7 @@ static int __devinit ipp_probe(struct platform_device *pdev) ctx->event_workq = create_singlethread_workqueue("ipp_event"); if (!ctx->event_workq) { dev_err(dev, "failed to create event workqueue\n"); - ret = -EINVAL; - goto err_clear; + return -EINVAL; } /* @@ -1953,8 +1952,6 @@ err_cmd_workq: destroy_workqueue(ctx->cmd_workq); err_event_workq: destroy_workqueue(ctx->event_workq); -err_clear: - kfree(ctx); return ret; } @@ -1980,8 +1977,6 @@ static int __devexit ipp_remove(struct platform_device *pdev) destroy_workqueue(ctx->cmd_workq); destroy_workqueue(ctx->event_workq); - kfree(ctx); - return 0; } |