Skip to content

Commit

Permalink
drm/exynos: Use devm_kzalloc in exynos_drm_ipp.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sachin Kamat authored and Inki Dae committed Jan 4, 2013
1 parent 1dcfe23 commit bfb6ed2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/gpu/drm/exynos/exynos_drm_ipp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}

/*
Expand Down Expand Up @@ -1953,8 +1952,6 @@ static int __devinit ipp_probe(struct platform_device *pdev)
destroy_workqueue(ctx->cmd_workq);
err_event_workq:
destroy_workqueue(ctx->event_workq);
err_clear:
kfree(ctx);
return ret;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit bfb6ed2

Please sign in to comment.