summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/img-hash.c
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-05-16 10:27:41 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2017-05-23 06:52:03 +0200
commit5f052c9c631d360d6ec6202714b9d6529a21117a (patch)
treec03d96231c92739172a4853253f162d4964b7c9e /drivers/crypto/img-hash.c
parenthwrng: omap3-rom - Handle return value of clk_prepare_enable (diff)
downloadlinux-5f052c9c631d360d6ec6202714b9d6529a21117a.tar.xz
linux-5f052c9c631d360d6ec6202714b9d6529a21117a.zip
crypto: img-hash - Handle return value of clk_prepare_enable
Here, Clock enable can failed. So adding an error check for clk_prepare_enable. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/img-hash.c')
-rw-r--r--drivers/crypto/img-hash.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c
index 9b07f3d88feb..0c6a917a9ab8 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;
}