summaryrefslogtreecommitdiff
path: root/drivers/crypto/stm32
diff options
context:
space:
mode:
authorEtienne Carriere <etienne.carriere@st.com>2020-04-27 09:42:24 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2020-05-08 08:30:39 +0300
commit43b05ce76733164e1c1b33ab16eda14130646c96 (patch)
tree11b906134f728b131039d9ff4af7ddf789d782a0 /drivers/crypto/stm32
parent12b3cf9093542d9f752a4968815ece836159013f (diff)
downloadlinux-43b05ce76733164e1c1b33ab16eda14130646c96.tar.xz
crypto: stm32/hash - defer probe for reset controller
Change stm32 HASH 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@st.com> Reviewed-by: Lionel DEBIEVE <lionel.debieve@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-hash.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c
index 167b80eec437..fad6190be088 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -1482,7 +1482,12 @@ static int stm32_hash_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
hdev->rst = devm_reset_control_get(&pdev->dev, NULL);
- if (!IS_ERR(hdev->rst)) {
+ if (IS_ERR(hdev->rst)) {
+ if (PTR_ERR(hdev->rst) == -EPROBE_DEFER) {
+ ret = -EPROBE_DEFER;
+ goto err_reset;
+ }
+ } else {
reset_control_assert(hdev->rst);
udelay(2);
reset_control_deassert(hdev->rst);
@@ -1535,7 +1540,7 @@ err_engine:
if (hdev->dma_lch)
dma_release_channel(hdev->dma_lch);
-
+err_reset:
pm_runtime_disable(dev);
pm_runtime_put_noidle(dev);