From: Fabio Estevam <festevam@gmail.com>
To: herbert@gondor.apana.org.au
Cc: christophe.leroy@c-s.fr, linux-crypto@vger.kernel.org,
horia.geanta@nxp.com, Fabio Estevam <festevam@gmail.com>
Subject: [PATCH v2] crypto: talitos - Use devm_platform_ioremap_resource()
Date: Thu, 6 Jun 2019 14:28:45 -0300 [thread overview]
Message-ID: <20190606172845.16864-1-festevam@gmail.com> (raw)
Use devm_platform_ioremap_resource() to simplify the code a bit.
While at it, remove unneeded error message in case of
devm_platform_ioremap_resource() failure, as the core mm code
will take care of it.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
- Adjust the error check for devm_platform_ioremap_resource()
- Remove error message on devm_platform_ioremap_resource() failure
drivers/crypto/talitos.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 32a7e747dc5f..688affec36c9 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -3336,7 +3336,6 @@ static int talitos_probe(struct platform_device *ofdev)
struct talitos_private *priv;
int i, err;
int stride;
- struct resource *res;
priv = devm_kzalloc(dev, sizeof(struct talitos_private), GFP_KERNEL);
if (!priv)
@@ -3350,13 +3349,9 @@ static int talitos_probe(struct platform_device *ofdev)
spin_lock_init(&priv->reg_lock);
- res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
- if (!res)
- return -ENXIO;
- priv->reg = devm_ioremap(dev, res->start, resource_size(res));
- if (!priv->reg) {
- dev_err(dev, "failed to of_iomap\n");
- err = -ENOMEM;
+ priv->reg = devm_platform_ioremap_resource(ofdev, 0);
+ if (IS_ERR(priv->reg)) {
+ err = PTR_ERR(priv->reg);
goto err_out;
}
--
2.17.1
next reply other threads:[~2019-06-06 17:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-06 17:28 Fabio Estevam [this message]
2019-06-06 17:45 ` [PATCH v2] crypto: talitos - Use devm_platform_ioremap_resource() Christophe Leroy
2019-06-06 17:51 ` Fabio Estevam
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=20190606172845.16864-1-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=christophe.leroy@c-s.fr \
--cc=herbert@gondor.apana.org.au \
--cc=horia.geanta@nxp.com \
--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