summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/stm32
diff options
context:
space:
mode:
authorEtienne Carriere <etienne.carriere@foss.st.com>2021-11-30 08:54:53 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2021-12-11 16:48:05 +1100
commit0a2f9f57c6ba4730f02df532e03316535a96fef8 (patch)
treee3716db6958b55be2d15bb5d270ca34921278e20 /drivers/crypto/stm32
parent3219c2b1bd4c4ed19f35bd83e3059c94077616e4 (diff)
downloadlinux-0a2f9f57c6ba4730f02df532e03316535a96fef8.tar.gz
linux-0a2f9f57c6ba4730f02df532e03316535a96fef8.tar.bz2
linux-0a2f9f57c6ba4730f02df532e03316535a96fef8.zip
crypto: stm32/cryp - defer probe for reset controller
Change stm32 CRYP driver to defer its probe operation when reset controller device is registered but has not been probed yet. Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/stm32')
-rw-r--r--drivers/crypto/stm32/stm32-cryp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/crypto/stm32/stm32-cryp.c b/drivers/crypto/stm32/stm32-cryp.c
index 7389a0536ff0..dcdd313485de 100644
--- a/drivers/crypto/stm32/stm32-cryp.c
+++ b/drivers/crypto/stm32/stm32-cryp.c
@@ -1973,7 +1973,11 @@ static int stm32_cryp_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
rst = devm_reset_control_get(dev, NULL);
- if (!IS_ERR(rst)) {
+ if (IS_ERR(rst)) {
+ ret = PTR_ERR(rst);
+ if (ret == -EPROBE_DEFER)
+ goto err_rst;
+ } else {
reset_control_assert(rst);
udelay(2);
reset_control_deassert(rst);
@@ -2024,7 +2028,7 @@ err_engine1:
spin_lock(&cryp_list.lock);
list_del(&cryp->list);
spin_unlock(&cryp_list.lock);
-
+err_rst:
pm_runtime_disable(dev);
pm_runtime_put_noidle(dev);
pm_runtime_disable(dev);