diff mbox

[4/5] drm/exynos: Use devm_clk_get in exynos_drm_g2d.c

Message ID 1353642119-10253-5-git-send-email-sachin.kamat@linaro.org
State Accepted
Headers show

Commit Message

Sachin Kamat Nov. 23, 2012, 3:41 a.m. UTC
devm_clk_get is device managed and makes error handling and exit code
simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/gpu/drm/exynos/exynos_drm_g2d.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

Comments

대인기/Tizen Platform Lab(SR)/삼성전자 Nov. 23, 2012, 7:06 a.m. UTC | #1
Applied.

Thanks,
Inki Dae

> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
> Sent: Friday, November 23, 2012 12:42 PM
> To: dri-devel@lists.freedesktop.org
> Cc: inki.dae@samsung.com; jy0922.shim@samsung.com; airlied@linux.ie;
> sachin.kamat@linaro.org; patches@linaro.org
> Subject: [PATCH 4/5] drm/exynos: Use devm_clk_get in exynos_drm_g2d.c
> 
> devm_clk_get is device managed and makes error handling and exit code
> simpler.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_g2d.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> index a9002ad..c1054cb 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
> @@ -1125,7 +1125,7 @@ static int __devinit g2d_probe(struct
> platform_device *pdev)
>  	mutex_init(&g2d->cmdlist_mutex);
>  	mutex_init(&g2d->runqueue_mutex);
> 
> -	g2d->gate_clk = clk_get(dev, "fimg2d");
> +	g2d->gate_clk = devm_clk_get(dev, "fimg2d");
>  	if (IS_ERR(g2d->gate_clk)) {
>  		dev_err(dev, "failed to get gate clock\n");
>  		ret = PTR_ERR(g2d->gate_clk);
> @@ -1181,7 +1181,6 @@ static int __devinit g2d_probe(struct
> platform_device *pdev)
> 
>  err_put_clk:
>  	pm_runtime_disable(dev);
> -	clk_put(g2d->gate_clk);
>  err_destroy_workqueue:
>  	destroy_workqueue(g2d->g2d_workq);
>  err_destroy_slab:
> @@ -1202,7 +1201,6 @@ static int __devexit g2d_remove(struct
> platform_device *pdev)
>  	}
> 
>  	pm_runtime_disable(&pdev->dev);
> -	clk_put(g2d->gate_clk);
> 
>  	g2d_fini_cmdlist(g2d);
>  	destroy_workqueue(g2d->g2d_workq);
> --
> 1.7.4.1
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
index a9002ad..c1054cb 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
@@ -1125,7 +1125,7 @@  static int __devinit g2d_probe(struct platform_device *pdev)
 	mutex_init(&g2d->cmdlist_mutex);
 	mutex_init(&g2d->runqueue_mutex);
 
-	g2d->gate_clk = clk_get(dev, "fimg2d");
+	g2d->gate_clk = devm_clk_get(dev, "fimg2d");
 	if (IS_ERR(g2d->gate_clk)) {
 		dev_err(dev, "failed to get gate clock\n");
 		ret = PTR_ERR(g2d->gate_clk);
@@ -1181,7 +1181,6 @@  static int __devinit g2d_probe(struct platform_device *pdev)
 
 err_put_clk:
 	pm_runtime_disable(dev);
-	clk_put(g2d->gate_clk);
 err_destroy_workqueue:
 	destroy_workqueue(g2d->g2d_workq);
 err_destroy_slab:
@@ -1202,7 +1201,6 @@  static int __devexit g2d_remove(struct platform_device *pdev)
 	}
 
 	pm_runtime_disable(&pdev->dev);
-	clk_put(g2d->gate_clk);
 
 	g2d_fini_cmdlist(g2d);
 	destroy_workqueue(g2d->g2d_workq);