Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642300 > unrolled thread

[PATCH v1] crypto: img-hash - Handle return value of clk_prepare_enable

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-05-16 10:30 +0200
Last post2017-05-23 07:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v1] crypto: img-hash - Handle return value of clk_prepare_enable Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-05-16 10:30 +0200
    Re: [PATCH v1] crypto: img-hash - Handle return value of  clk_prepare_enable Herbert Xu <herbert@gondor.apana.org.au> - 2017-05-23 07:10 +0200

#1642300 — [PATCH v1] crypto: img-hash - Handle return value of clk_prepare_enable

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-05-16 10:30 +0200
Subject[PATCH v1] crypto: img-hash - Handle return value of clk_prepare_enable
Message-ID<tHG1H-3fa-3@gated-at.bofh.it>
Here, Clock enable can failed. So adding an error check for
clk_prepare_enable.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/crypto/img-hash.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c
index 9b07f3d8..0c6a917 100644
--- a/drivers/crypto/img-hash.c
+++ b/drivers/crypto/img-hash.c
@@ -1088,9 +1088,17 @@ static int img_hash_suspend(struct device *dev)
 static int img_hash_resume(struct device *dev)
 {
 	struct img_hash_dev *hdev = dev_get_drvdata(dev);
+	int ret;
 
-	clk_prepare_enable(hdev->hash_clk);
-	clk_prepare_enable(hdev->sys_clk);
+	ret = clk_prepare_enable(hdev->hash_clk);
+	if (ret)
+		return ret;
+
+	ret = clk_prepare_enable(hdev->sys_clk);
+	if (ret) {
+		clk_disable_unprepare(hdev->hash_clk);
+		return ret;
+	}
 
 	return 0;
 }
-- 
1.9.1

[toc] | [next] | [standalone]


#1647630 — Re: [PATCH v1] crypto: img-hash - Handle return value of clk_prepare_enable

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2017-05-23 07:10 +0200
SubjectRe: [PATCH v1] crypto: img-hash - Handle return value of clk_prepare_enable
Message-ID<tKaeZ-77l-5@gated-at.bofh.it>
In reply to#1642300
On Tue, May 16, 2017 at 01:57:41PM +0530, Arvind Yadav wrote:
> Here, Clock enable can failed. So adding an error check for
> clk_prepare_enable.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web