All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suman Anna <s-anna@ti.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>
Cc: Deepak Saxena <dsaxena@plexity.net>,
	Tero Kristo <kristo@kernel.org>, Keerthy <j-keerthy@ti.com>,
	Gowtham Tammana <g-tammana@ti.com>,
	Vaibhav Gupta <v_gupta@ti.com>, <linux-crypto@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Suman Anna <s-anna@ti.com>
Subject: [PATCH 5/6] crypto: sa2ul - Use devm_platform_ioremap_resource()
Date: Fri, 14 May 2021 11:12:45 -0500	[thread overview]
Message-ID: <20210514161246.22517-6-s-anna@ti.com> (raw)
In-Reply-To: <20210514161246.22517-1-s-anna@ti.com>

Simplify the platform_get_resource() and devm_ioremap_resource()
calls with devm_platform_ioremap_resource(). Also add error checking
and move up this block to simplify the cleanup in sa_ul_probe().

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 drivers/crypto/sa2ul.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index 9f077ec9dbb7..216702fef945 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -2390,7 +2390,6 @@ static int sa_ul_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct device_node *node = dev->of_node;
-	struct resource *res;
 	static void __iomem *saul_base;
 	struct sa_crypto_data *dev_data;
 	int ret;
@@ -2403,9 +2402,14 @@ static int sa_ul_probe(struct platform_device *pdev)
 	if (!dev_data->match_data)
 		return -ENODEV;
 
+	saul_base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(saul_base))
+		return PTR_ERR(saul_base);
+
 	sa_k3_dev = dev;
 	dev_data->dev = dev;
 	dev_data->pdev = pdev;
+	dev_data->base = saul_base;
 	platform_set_drvdata(pdev, dev_data);
 	dev_set_drvdata(sa_k3_dev, dev_data);
 
@@ -2424,10 +2428,6 @@ static int sa_ul_probe(struct platform_device *pdev)
 		goto destroy_dma_pool;
 
 	spin_lock_init(&dev_data->scid_lock);
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	saul_base = devm_ioremap_resource(dev, res);
-
-	dev_data->base = saul_base;
 
 	if (!dev_data->match_data->skip_engine_control) {
 		u32 val = SA_EEC_ENCSS_EN | SA_EEC_AUTHSS_EN | SA_EEC_CTXCACH_EN |
-- 
2.30.1


  parent reply	other threads:[~2021-05-14 16:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 16:12 [PATCH 0/6] Misc. SA2UL fixes/cleanups Suman Anna
2021-05-14 16:12 ` [PATCH 1/6] hwrng: omap - Enable driver for TI K3 family Suman Anna
2021-05-14 16:12 ` [PATCH 2/6] crypto: sa2ul - Fix leaks on failure paths with sa_dma_init() Suman Anna
2021-05-14 16:12 ` [PATCH 3/6] crypto: sa2ul - Fix pm_runtime enable in sa_ul_probe() Suman Anna
2021-05-14 16:12 ` [PATCH 4/6] crypto: sa2ul - Use of_device_get_match_data() helper Suman Anna
2021-05-14 16:12 ` Suman Anna [this message]
2021-05-14 16:12 ` [PATCH 6/6] crypto: sa2ul - Remove child devices in remove Suman Anna
2021-05-17  6:09 ` [PATCH 0/6] Misc. SA2UL fixes/cleanups Tero Kristo
2021-05-21  8:23 ` Herbert Xu

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=20210514161246.22517-6-s-anna@ti.com \
    --to=s-anna@ti.com \
    --cc=davem@davemloft.net \
    --cc=dsaxena@plexity.net \
    --cc=g-tammana@ti.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=j-keerthy@ti.com \
    --cc=kristo@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v_gupta@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.