diff mbox

[2/4,media] exynos-gsc: Remove gsc_clk_put call from gsc_clk_get

Message ID 1353645902-7467-3-git-send-email-sachin.kamat@linaro.org
State Superseded
Headers show

Commit Message

Sachin Kamat Nov. 23, 2012, 4:45 a.m. UTC
Since this function just returns (since gsc->clock is NULL),
remove it and make the exit code simpler.

Cc: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/media/platform/exynos-gsc/gsc-core.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Comments

On 11/23/2012 05:45 AM, Sachin Kamat wrote:
> Since this function just returns (since gsc->clock is NULL),
> remove it and make the exit code simpler.
> 
> Cc: Shaik Ameer Basha <shaik.ameer@samsung.com>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/media/platform/exynos-gsc/gsc-core.c |    8 +++-----
>  1 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
> index 45bcfa7..99ee1a9 100644
> --- a/drivers/media/platform/exynos-gsc/gsc-core.c
> +++ b/drivers/media/platform/exynos-gsc/gsc-core.c
> @@ -1020,7 +1020,7 @@ static int gsc_clk_get(struct gsc_dev *gsc)
>  	if (IS_ERR(gsc->clock)) {
>  		dev_err(&gsc->pdev->dev, "failed to get clock~~~: %s\n",
>  			GSC_CLOCK_GATE_NAME);
> -		goto err_clk_get;
> +		goto err;
>  	}
>  
>  	ret = clk_prepare(gsc->clock);
> @@ -1029,14 +1029,12 @@ static int gsc_clk_get(struct gsc_dev *gsc)
>  			GSC_CLOCK_GATE_NAME);
>  		clk_put(gsc->clock);
>  		gsc->clock = NULL;
> -		goto err_clk_prepare;
> +		goto err;
>  	}
>  
>  	return 0;
>  
> -err_clk_prepare:
> -	gsc_clk_put(gsc);
> -err_clk_get:

Hmm, ok, here come the remaining part of the cleanup..
I think this patch can be folded into the previous one.

> +err:
>  	return -ENXIO;
>  }
diff mbox

Patch

diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index 45bcfa7..99ee1a9 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -1020,7 +1020,7 @@  static int gsc_clk_get(struct gsc_dev *gsc)
 	if (IS_ERR(gsc->clock)) {
 		dev_err(&gsc->pdev->dev, "failed to get clock~~~: %s\n",
 			GSC_CLOCK_GATE_NAME);
-		goto err_clk_get;
+		goto err;
 	}
 
 	ret = clk_prepare(gsc->clock);
@@ -1029,14 +1029,12 @@  static int gsc_clk_get(struct gsc_dev *gsc)
 			GSC_CLOCK_GATE_NAME);
 		clk_put(gsc->clock);
 		gsc->clock = NULL;
-		goto err_clk_prepare;
+		goto err;
 	}
 
 	return 0;
 
-err_clk_prepare:
-	gsc_clk_put(gsc);
-err_clk_get:
+err:
 	return -ENXIO;
 }