From: Fabio Estevam <festevam@gmail.com>
To: herbert@gondor.apana.org.au
Cc: tobias.rauter@gmail.com, linux-crypto@vger.kernel.org,
Fabio Estevam <fabio.estevam@freescale.com>
Subject: [PATCH 1/3] crypto: dcp: Use devm_ioremap_resource()
Date: Sun, 22 Sep 2013 14:42:25 -0300 [thread overview]
Message-ID: <1379871747-17570-1-git-send-email-festevam@gmail.com> (raw)
From: Fabio Estevam <fabio.estevam@freescale.com>
Using devm_ioremap_resource() can make the code simpler and smaller.
When devm_ioremap_resource() is used there is no need to explicitely check the
error returned by platform_get_resource().
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/crypto/dcp.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/crypto/dcp.c b/drivers/crypto/dcp.c
index a8a7dd4..90a7cb7 100644
--- a/drivers/crypto/dcp.c
+++ b/drivers/crypto/dcp.c
@@ -733,12 +733,7 @@ static int dcp_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dev);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!r) {
- dev_err(&pdev->dev, "failed to get IORESOURCE_MEM\n");
- return -ENXIO;
- }
- dev->dcp_regs_base = devm_ioremap(&pdev->dev, r->start,
- resource_size(r));
+ dev->dcp_regs_base = devm_ioremap_resource(&pdev->dev, r);
dcp_set(dev, DCP_CTRL_SFRST, DCP_REG_CTRL);
udelay(10);
--
1.8.1.2
next reply other threads:[~2013-09-22 17:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-22 17:42 Fabio Estevam [this message]
2013-09-22 17:42 ` [PATCH 2/3] crypto: dcp: Use devm_request_irq() Fabio Estevam
2013-09-22 17:42 ` [PATCH 3/3] crypto: dcp: Fix the path for releasing the resources Fabio Estevam
2013-09-23 20:09 ` [PATCH 1/3] crypto: dcp - Use devm_ioremap_resource() 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=1379871747-17570-1-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=tobias.rauter@gmail.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 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).