summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/inside-secure
diff options
context:
space:
mode:
authorGregory CLEMENT <gregory.clement@bootlin.com>2018-03-13 17:48:41 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2018-03-23 16:39:59 +0100
commit5b37689653cbe73d24760428c236feb15ccad2aa (patch)
treed58d3775c486ee7bc1ba5b1bb8edf87d3ab27bb5 /drivers/crypto/inside-secure
parentcrypto: inside-secure - fix clock management (diff)
downloadlinux-5b37689653cbe73d24760428c236feb15ccad2aa.tar.xz
linux-5b37689653cbe73d24760428c236feb15ccad2aa.zip
crypto: inside-secure - improve clock initialization
The clock is optional, but if it is present we should managed it. If there is an error while trying getting it, we should exit and report this error. So instead of returning an error only in the -EPROBE case, turn it in an other way and ignore the clock only if it is not present (-ENOENT case). Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/inside-secure')
-rw-r--r--drivers/crypto/inside-secure/safexcel.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c
index 09adeaa0da6b..cbcb5d9f17bd 100644
--- a/drivers/crypto/inside-secure/safexcel.c
+++ b/drivers/crypto/inside-secure/safexcel.c
@@ -882,16 +882,17 @@ static int safexcel_probe(struct platform_device *pdev)
}
priv->clk = devm_clk_get(&pdev->dev, NULL);
- if (!IS_ERR(priv->clk)) {
+ ret = PTR_ERR_OR_ZERO(priv->clk);
+ /* The clock isn't mandatory */
+ if (ret != -ENOENT) {
+ if (ret)
+ return ret;
+
ret = clk_prepare_enable(priv->clk);
if (ret) {
dev_err(dev, "unable to enable clk (%d)\n", ret);
return ret;
}
- } else {
- /* The clock isn't mandatory */
- if (PTR_ERR(priv->clk) == -EPROBE_DEFER)
- return -EPROBE_DEFER;
}
ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));