diff mbox

[-next] gpu: host1x: add missing clk_disable_unprepare() on error in host1x_probe()

Message ID CAPgLHd_Tw1Os0mT1NgcipJ+fhhbsS+s-Ba-tksUXqFV2cY_ZjQ@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Oct. 21, 2013, 5:37 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add the missing clk_disable_unprepare() before return
from host1x_probe() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpu/host1x/dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Terje Bergstrom Oct. 28, 2013, 8:24 a.m. UTC | #1
On 21.10.2013 08:37, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing clk_disable_unprepare() before return
> from host1x_probe() in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/gpu/host1x/dev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> index 12d6333..646a333 100644
> --- a/drivers/gpu/host1x/dev.c
> +++ b/drivers/gpu/host1x/dev.c
> @@ -154,7 +154,7 @@ static int host1x_probe(struct platform_device *pdev)
>  	err = host1x_syncpt_init(host);
>  	if (err) {
>  		dev_err(&pdev->dev, "failed to initialize syncpts\n");
> -		return err;
> +		goto fail_unprepare_disable;
>  	}
>  
>  	err = host1x_intr_init(host, syncpt_irq);
> @@ -175,6 +175,8 @@ fail_deinit_intr:
>  	host1x_intr_deinit(host);
>  fail_deinit_syncpt:
>  	host1x_syncpt_deinit(host);
> +fail_unprepare_disable:
> +	clk_disable_unprepare(host->clk);
>  	return err;
>  }

Looks good.

Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>

Terje
Thierry Reding Oct. 28, 2013, 8:52 a.m. UTC | #2
On Mon, Oct 21, 2013 at 01:37:31PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing clk_disable_unprepare() before return
> from host1x_probe() in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/gpu/host1x/dev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied, thanks.

Thierry
diff mbox

Patch

diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index 12d6333..646a333 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -154,7 +154,7 @@  static int host1x_probe(struct platform_device *pdev)
 	err = host1x_syncpt_init(host);
 	if (err) {
 		dev_err(&pdev->dev, "failed to initialize syncpts\n");
-		return err;
+		goto fail_unprepare_disable;
 	}
 
 	err = host1x_intr_init(host, syncpt_irq);
@@ -175,6 +175,8 @@  fail_deinit_intr:
 	host1x_intr_deinit(host);
 fail_deinit_syncpt:
 	host1x_syncpt_deinit(host);
+fail_unprepare_disable:
+	clk_disable_unprepare(host->clk);
 	return err;
 }