8ab1199e9d024604ef4c098b30ae17b156d2cf07
[openwrt/staging/pepe2k.git] /
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
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
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.
12
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)
24 ---
25 drivers/crypto/caam/ctrl.c | 13 ++++++-------
26 1 file changed, 6 insertions(+), 7 deletions(-)
27
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
31 #endif
32 }
33
34 - ret = devm_of_platform_populate(dev);
35 - if (ret) {
36 - dev_err(dev, "JR platform devices creation error\n");
37 - return ret;
38 - }
39 -
40 ring = 0;
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);
46 #endif
47 - return 0;
48 +
49 + ret = devm_of_platform_populate(dev);
50 + if (ret)
51 + dev_err(dev, "JR platform devices creation error\n");
52 +
53 + return ret;
54 }
55
56 static struct platform_driver caam_driver = {