diff mbox

thermal: rockchip: disable thermal->clk in err case

Message ID 1455503242-19907-1-git-send-email-shawn.lin@rock-chips.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Shawn Lin Feb. 15, 2016, 2:27 a.m. UTC
Disable thermal->clk when enabling pclk fails in
resume routine.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/thermal/rockchip_thermal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Heiko Stübner March 1, 2016, 11:48 a.m. UTC | #1
Am Montag, 15. Februar 2016, 10:27:22 schrieb Shawn Lin:
> Disable thermal->clk when enabling pclk fails in
> resume routine.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
> 
>  drivers/thermal/rockchip_thermal.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/rockchip_thermal.c
> b/drivers/thermal/rockchip_thermal.c index 9787e8a..b54f6db 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -656,8 +656,10 @@ static int __maybe_unused
> rockchip_thermal_resume(struct device *dev) return error;
> 
>  	error = clk_enable(thermal->pclk);
> -	if (error)
> +	if (error) {
> +		clk_disable(thermal->clk);
>  		return error;
> +	}
> 
>  	rockchip_thermal_reset_controller(thermal->reset);

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Caesar Wang March 3, 2016, 3:34 a.m. UTC | #2
Hi ,

Sorry for the missing it.

? 2016?02?15? 10:27, Shawn Lin ??:
> Disable thermal->clk when enabling pclk fails in
> resume routine.
>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>

Reviewed-by: Caesar Wang <wxt@rock-chips.com>

> ---
>
>   drivers/thermal/rockchip_thermal.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
> index 9787e8a..b54f6db 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -656,8 +656,10 @@ static int __maybe_unused rockchip_thermal_resume(struct device *dev)
>   		return error;
>   
>   	error = clk_enable(thermal->pclk);
> -	if (error)
> +	if (error) {
> +		clk_disable(thermal->clk);
>   		return error;
> +	}
>   
>   	rockchip_thermal_reset_controller(thermal->reset);
>
diff mbox

Patch

diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 9787e8a..b54f6db 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -656,8 +656,10 @@  static int __maybe_unused rockchip_thermal_resume(struct device *dev)
 		return error;
 
 	error = clk_enable(thermal->pclk);
-	if (error)
+	if (error) {
+		clk_disable(thermal->clk);
 		return error;
+	}
 
 	rockchip_thermal_reset_controller(thermal->reset);