linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
	<linux-crypto@vger.kernel.org>
Subject: [PATCHv2 5/7] crypto: sa2ul: add device links to child devices
Date: Fri, 24 Apr 2020 19:44:28 +0300	[thread overview]
Message-ID: <20200424164430.3288-6-t-kristo@ti.com> (raw)
In-Reply-To: <20200424164430.3288-1-t-kristo@ti.com>

The child devices for sa2ul (like the RNG) have hard dependency towards
the parent, they can't function without the parent enabled. Add device
link for this purpose so that the dependencies are taken care of properly.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 drivers/crypto/sa2ul.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index 899ef90a3d76..9483b199df6c 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -2339,6 +2339,15 @@ static int sa_dma_init(struct sa_crypto_data *dd)
 	return ret;
 }
 
+static int sa_link_child(struct device *dev, void *data)
+{
+	struct device *parent = data;
+
+	device_link_add(dev, parent, DL_FLAG_AUTOPROBE_CONSUMER);
+
+	return 0;
+}
+
 static int sa_ul_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -2389,6 +2398,8 @@ static int sa_ul_probe(struct platform_device *pdev)
 	if (ret)
 		goto release_dma;
 
+	device_for_each_child(&pdev->dev, &pdev->dev, sa_link_child);
+
 	return 0;
 
 release_dma:
-- 
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

  parent reply	other threads:[~2020-04-24 16:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 16:44 [PATCHv2 0/7] crypto: TI SA2UL crypto accelerator support Tero Kristo
2020-04-24 16:44 ` [PATCHv2 1/7] dt-bindings: crypto: Add TI SA2UL crypto accelerator documentation Tero Kristo
2020-05-11 21:53   ` Rob Herring
2020-05-12  4:47     ` Tero Kristo
2020-05-14 12:50     ` [PATCHv3 " Tero Kristo
2020-05-26 13:16       ` Tero Kristo
2020-05-28 15:23       ` Rob Herring
2020-06-03 10:01         ` Tero Kristo
2020-06-03 12:27           ` Herbert Xu
2020-06-03 12:38             ` Tero Kristo
2020-06-03 12:39               ` Herbert Xu
2020-06-03 12:53                 ` Tero Kristo
2020-06-03 12:54                   ` Herbert Xu
2020-04-24 16:44 ` [PATCHv2 2/7] crypto: sa2ul: Add crypto driver Tero Kristo
2020-04-24 16:44 ` [PATCHv2 3/7] crypto: sa2ul: add sha1/sha256/sha512 support Tero Kristo
2020-04-24 16:44 ` [PATCHv2 4/7] crypto: sa2ul: Add AEAD algorithm support Tero Kristo
2020-04-24 16:44 ` Tero Kristo [this message]
2020-04-24 16:44 ` [PATCHv2 6/7] arm64: dts: ti: k3-am6: Add crypto accelarator node Tero Kristo
2020-04-24 16:44 ` [PATCHv2 7/7] arm64: dts: ti: k3-j721e-main: Add crypto accelerator node Tero Kristo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200424164430.3288-6-t-kristo@ti.com \
    --to=t-kristo@ti.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).