diff mbox

[1/1] drm/exynos: remove unnecessary clk_disable calls in exynos_drm_fimd.c

Message ID 1353665172-6754-1-git-send-email-sachin.kamat@linaro.org
State Superseded
Headers show

Commit Message

Sachin Kamat Nov. 23, 2012, 10:06 a.m. UTC
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 |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

Comments

대인기/Tizen Platform Lab(SR)/삼성전자 Nov. 24, 2012, 5:40 a.m. UTC | #1
> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
> Sent: Friday, November 23, 2012 7:06 PM
> To: dri-devel@lists.freedesktop.org
> Cc: inki.dae@samsung.com; sachin.kamat@linaro.org; patches@linaro.org
> Subject: [PATCH 1/1] drm/exynos: remove unnecessary clk_disable calls in
> exynos_drm_fimd.c
> 
> 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 |   22 +++++-----------------
>  1 files changed, 5 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> index 57851cc..00bd266 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> @@ -849,15 +849,13 @@ static int __devinit fimd_probe(struct
> platform_device *pdev)
>  	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 = 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;

Let's combine the above changes with previous patch, 'drm/exynos: Use
devm_clk_get in exynos_drm_fimd.c'. For this, reverted old one.

>  	}
> 
>  	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,15 +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);
> -
> -err_bus_clk:
> -	clk_disable(ctx->bus_clk);
> -
> -err_clk_get:
> -	return ret;

And separated one.

Thanks,
Inki Dae

>  }
> 
>  static int __devexit fimd_remove(struct platform_device *pdev)
> --
> 1.7.4.1
Sachin Kamat Nov. 26, 2012, 4:23 a.m. UTC | #2
Ok. Mailed you the combined patch.

On 24 November 2012 11:10, Inki Dae <inki.dae@samsung.com> wrote:
>
>
>> -----Original Message-----
>> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
>> Sent: Friday, November 23, 2012 7:06 PM
>> To: dri-devel@lists.freedesktop.org
>> Cc: inki.dae@samsung.com; sachin.kamat@linaro.org; patches@linaro.org
>> Subject: [PATCH 1/1] drm/exynos: remove unnecessary clk_disable calls in
>> exynos_drm_fimd.c
>>
>> 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 |   22 +++++-----------------
>>  1 files changed, 5 insertions(+), 17 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> index 57851cc..00bd266 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
>> @@ -849,15 +849,13 @@ static int __devinit fimd_probe(struct
>> platform_device *pdev)
>>       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 = 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;
>
> Let's combine the above changes with previous patch, 'drm/exynos: Use
> devm_clk_get in exynos_drm_fimd.c'. For this, reverted old one.
>
>>       }
>>
>>       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,15 +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);
>> -
>> -err_bus_clk:
>> -     clk_disable(ctx->bus_clk);
>> -
>> -err_clk_get:
>> -     return ret;
>
> And separated one.
>
> Thanks,
> Inki Dae
>
>>  }
>>
>>  static int __devexit fimd_remove(struct platform_device *pdev)
>> --
>> 1.7.4.1
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 57851cc..00bd266 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -849,15 +849,13 @@  static int __devinit fimd_probe(struct platform_device *pdev)
 	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 = 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,15 +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);
-
-err_bus_clk:
-	clk_disable(ctx->bus_clk);
-
-err_clk_get:
-	return ret;
 }
 
 static int __devexit fimd_remove(struct platform_device *pdev)