diff mbox

[-next] hwrng: atmel - use clk_disable_unprepare instead of clk_disable

Message ID 1478876207-29820-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Wei Yongjun Nov. 11, 2016, 2:56 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Since clk_prepare_enable() is used to get trng->clk, we should
use clk_disable_unprepare() to release it for the error path.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/char/hw_random/atmel-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Nicolas Ferre Nov. 14, 2016, 8:02 a.m. UTC | #1
Le 11/11/2016 à 15:56, Wei Yongjun a écrit :
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Since clk_prepare_enable() is used to get trng->clk, we should
> use clk_disable_unprepare() to release it for the error path.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thank you.

Best regards,

> ---
>  drivers/char/hw_random/atmel-rng.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
> index ae7cae5..661c82c 100644
> --- a/drivers/char/hw_random/atmel-rng.c
> +++ b/drivers/char/hw_random/atmel-rng.c
> @@ -94,7 +94,7 @@ static int atmel_trng_probe(struct platform_device *pdev)
>  	return 0;
>  
>  err_register:
> -	clk_disable(trng->clk);
> +	clk_disable_unprepare(trng->clk);
>  	return ret;
>  }
> 
>
diff mbox

Patch

diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index ae7cae5..661c82c 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -94,7 +94,7 @@  static int atmel_trng_probe(struct platform_device *pdev)
 	return 0;
 
 err_register:
-	clk_disable(trng->clk);
+	clk_disable_unprepare(trng->clk);
 	return ret;
 }