[PATCH 1/5] drm/exynos: Use devm_clk_get in exynos_drm_fimd.c
Inki Dae
inki.dae at samsung.com
Thu Nov 22 22:40:06 PST 2012
> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat at linaro.org]
> Sent: Friday, November 23, 2012 12:42 PM
> To: dri-devel at lists.freedesktop.org
> Cc: inki.dae at samsung.com; jy0922.shim at samsung.com; airlied at linux.ie;
> sachin.kamat at linaro.org; patches at linaro.org
> Subject: [PATCH 1/5] drm/exynos: Use devm_clk_get in exynos_drm_fimd.c
>
> devm_clk_get is device managed and makes error handling and exit code
> simpler.
>
> Signed-off-by: Sachin Kamat <sachin.kamat at linaro.org>
> ---
> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 ++-------
> 1 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index ad04edd..57851cc 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -846,14 +846,14 @@ static int __devinit fimd_probe(struct
> platform_device *pdev)
> if (!ctx)
> return -ENOMEM;
>
> - ctx->bus_clk = clk_get(dev, "fimd");
> + ctx->bus_clk = devm_clk_get(dev, "fimd");
> if (IS_ERR(ctx->bus_clk)) {
> dev_err(dev, "failed to get bus clock\n");
> ret = PTR_ERR(ctx->bus_clk);
> goto err_clk_get;
> }
>
> - ctx->lcd_clk = clk_get(dev, "sclk_fimd");
> + ctx->lcd_clk = devm_clk_get(dev, "sclk_fimd");
> if (IS_ERR(ctx->lcd_clk)) {
> dev_err(dev, "failed to get lcd clock\n");
> ret = PTR_ERR(ctx->lcd_clk);
> @@ -918,11 +918,9 @@ static int __devinit fimd_probe(struct
> platform_device *pdev)
>
> err_clk:
> clk_disable(ctx->lcd_clk);
> - clk_put(ctx->lcd_clk);
clk_disable shouldn't be called here so let's cleanup this also to reduce
unnecessary cleanup commits.
>
> err_bus_clk:
> clk_disable(ctx->bus_clk);
> - clk_put(ctx->bus_clk);
>
Ditto.
Thanks,
Inki Dae
> err_clk_get:
> return ret;
> @@ -949,9 +947,6 @@ static int __devexit fimd_remove(struct
> platform_device *pdev)
> out:
> pm_runtime_disable(dev);
>
> - clk_put(ctx->lcd_clk);
> - clk_put(ctx->bus_clk);
> -
> return 0;
> }
>
> --
> 1.7.4.1
More information about the dri-devel
mailing list