1 From 6d186bceac74dd7fcabac860295cfb7b893168cd Mon Sep 17 00:00:00 2001
2 From: Andrey Smirnov <andrew.smirnov@gmail.com>
3 Date: Tue, 22 Oct 2019 08:30:13 -0700
4 Subject: [PATCH] crypto: caam - populate platform devices last
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Move the call to devm_of_platform_populate() at the end of
10 caam_probe(), so we won't try to add any child devices until all of
11 the initialization is finished successfully.
13 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
14 Cc: Chris Healy <cphealy@gmail.com>
15 Cc: Lucas Stach <l.stach@pengutronix.de>
16 Cc: Horia Geantă <horia.geanta@nxp.com>
17 Cc: Herbert Xu <herbert@gondor.apana.org.au>
18 Cc: Iuliana Prodan <iuliana.prodan@nxp.com>
19 Cc: linux-crypto@vger.kernel.org
20 Cc: linux-kernel@vger.kernel.org
21 Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
22 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
23 (cherry picked from commit 51d13aaf59779ff4d13f1def2c72ae102a1aad40)
25 drivers/crypto/caam/ctrl.c | 13 ++++++-------
26 1 file changed, 6 insertions(+), 7 deletions(-)
28 --- a/drivers/crypto/caam/ctrl.c
29 +++ b/drivers/crypto/caam/ctrl.c
30 @@ -745,12 +745,6 @@ static int caam_probe(struct platform_de
34 - ret = devm_of_platform_populate(dev);
36 - dev_err(dev, "JR platform devices creation error\n");
41 for_each_available_child_of_node(nprop, np)
42 if (of_device_is_compatible(np, "fsl,sec-v4.0-job-ring") ||
43 @@ -903,7 +897,12 @@ static int caam_probe(struct platform_de
44 debugfs_create_blob("tdsk", S_IRUSR | S_IRGRP | S_IROTH, ctrlpriv->ctl,
45 &ctrlpriv->ctl_tdsk_wrap);
49 + ret = devm_of_platform_populate(dev);
51 + dev_err(dev, "JR platform devices creation error\n");
56 static struct platform_driver caam_driver = {