[RFC v1 PATCH 2/3] caam: add defer probe when the caam driver cannot identify SoC

From: Alice Guo (OSS)
Date: Mon Apr 19 2021 - 00:28:39 EST


From: Alice Guo <alice.guo@xxxxxxx>

When imx8_soc_info_driver uses module_platform_driver() to regitser
itself, the caam driver cannot identify the SoC in the machine because
the SoC driver is probed later, so that add return -EPROBE_DEFER.

Signed-off-by: Alice Guo <alice.guo@xxxxxxx>
---
drivers/crypto/caam/ctrl.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index ca0361b2dbb0..d08f8cc4131f 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -635,6 +635,9 @@ static int caam_probe(struct platform_device *pdev)
nprop = pdev->dev.of_node;

imx_soc_match = soc_device_match(caam_imx_soc_table);
+ if (IS_ERR(imx_soc_match))
+ return PTR_ERR(imx_soc_match);
+
caam_imx = (bool)imx_soc_match;

if (imx_soc_match) {
--
2.17.1