From: Inki Dae <inki.dae@samsung.com>
To: 'Sachin Kamat' <sachin.kamat@linaro.org>,
dri-devel@lists.freedesktop.org
Cc: patches@linaro.org
Subject: RE: [PATCH Resend] drm/exynos: Use devm_clk_get in exynos_drm_fimd.c
Date: Mon, 26 Nov 2012 14:59:42 +0900 [thread overview]
Message-ID: <002601cdcb9b$3a855b40$af9011c0$%dae@samsung.com> (raw)
In-Reply-To: <1353903434-12682-1-git-send-email-sachin.kamat@linaro.org>
Applied.
Thanks,
Inki Dae
> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
> Sent: Monday, November 26, 2012 1:17 PM
> To: dri-devel@lists.freedesktop.org
> Cc: inki.dae@samsung.com; sachin.kamat@linaro.org; patches@linaro.org;
> airlied@linux.ie
> Subject: [PATCH Resend] 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.
> Also fixes an error related to returning 'ret' without initialising
> with error code.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 31
++++++--------------------
> ---
> 1 files changed, 7 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index ad04edd..00bd266 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -846,18 +846,16 @@ 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;
> + return PTR_ERR(ctx->bus_clk);
> }
>
> - 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);
> - goto err_bus_clk;
> + return PTR_ERR(ctx->lcd_clk);
> }
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -865,14 +863,13 @@ static int __devinit fimd_probe(struct
> platform_device *pdev)
> ctx->regs = devm_request_and_ioremap(&pdev->dev, res);
> if (!ctx->regs) {
> dev_err(dev, "failed to map registers\n");
> - ret = -ENXIO;
> - goto err_clk;
> + return -ENXIO;
> }
>
> res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> if (!res) {
> dev_err(dev, "irq request failed.\n");
> - goto err_clk;
> + return -ENXIO;
> }
>
> ctx->irq = res->start;
> @@ -881,7 +878,7 @@ static int __devinit fimd_probe(struct platform_device
> *pdev)
> 0, "drm_fimd", ctx);
> if (ret) {
> dev_err(dev, "irq request failed.\n");
> - goto err_clk;
> + return ret;
> }
>
> ctx->vidcon0 = pdata->vidcon0;
> @@ -915,17 +912,6 @@ static int __devinit fimd_probe(struct
> platform_device *pdev)
> exynos_drm_subdrv_register(subdrv);
>
> return 0;
> -
> -err_clk:
> - clk_disable(ctx->lcd_clk);
> - clk_put(ctx->lcd_clk);
> -
> -err_bus_clk:
> - clk_disable(ctx->bus_clk);
> - clk_put(ctx->bus_clk);
> -
> -err_clk_get:
> - return ret;
> }
>
> static int __devexit fimd_remove(struct platform_device *pdev)
> @@ -949,9 +935,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
next prev parent reply other threads:[~2012-11-26 5:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 4:17 [PATCH Resend] drm/exynos: Use devm_clk_get in exynos_drm_fimd.c Sachin Kamat
2012-11-26 5:59 ` Inki Dae [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-11-23 8:43 [PATCH Resend] drm/exynos: Use devm_clk_get in exynos_mixer.c Sachin Kamat
2012-11-23 8:43 ` [PATCH Resend] drm/exynos: Use devm_clk_get in exynos_drm_fimd.c Sachin Kamat
2012-11-23 9:51 ` Inki Dae
2012-11-23 9:53 ` Sachin Kamat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002601cdcb9b$3a855b40$af9011c0$%dae@samsung.com' \
--to=inki.dae@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=patches@linaro.org \
--cc=sachin.kamat@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox