From: Jingoo Han <jg1.han@samsung.com>
To: "'Herbert Xu'" <herbert@gondor.apana.org.au>
Cc: linux-kernel@vger.kernel.org,
"'Jamie Iles'" <jamie@jamieiles.com>,
"'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH 2/2] hwrng: pixocell - Use devm_ioremap_resource()
Date: Wed, 12 Feb 2014 14:19:48 +0900 [thread overview]
Message-ID: <000101cf27b2$0caf9810$260ec830$%han@samsung.com> (raw)
In-Reply-To: <000001cf27b1$acf29f30$06d7dd90$%han@samsung.com>
Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because the value is checked by devm_ioremap_resource().
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/char/hw_random/picoxcell-rng.c | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/drivers/char/hw_random/picoxcell-rng.c b/drivers/char/hw_random/picoxcell-rng.c
index 3d4c229..c03beee 100644
--- a/drivers/char/hw_random/picoxcell-rng.c
+++ b/drivers/char/hw_random/picoxcell-rng.c
@@ -104,22 +104,9 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
int ret;
struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!mem) {
- dev_warn(&pdev->dev, "no memory resource\n");
- return -ENOMEM;
- }
-
- if (!devm_request_mem_region(&pdev->dev, mem->start, resource_size(mem),
- "picoxcell_trng")) {
- dev_warn(&pdev->dev, "unable to request io mem\n");
- return -EBUSY;
- }
-
- rng_base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
- if (!rng_base) {
- dev_warn(&pdev->dev, "unable to remap io mem\n");
- return -ENOMEM;
- }
+ rng_base = devm_ioremap_resource(&pdev->dev, mem);
+ if (IS_ERR(rng_base))
+ return PTR_ERR(rng_base);
rng_clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(rng_clk)) {
--
1.7.10.4
next prev parent reply other threads:[~2014-02-12 5:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 5:17 [PATCH 1/2] hwrng: atmel " Jingoo Han
2014-02-12 5:19 ` Jingoo Han [this message]
2014-02-12 7:46 ` Peter Korsgaard
2014-02-12 8:12 ` Nicolas Ferre
2014-02-25 12:17 ` 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='000101cf27b2$0caf9810$260ec830$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=herbert@gondor.apana.org.au \
--cc=jamie@jamieiles.com \
--cc=linux-kernel@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
Powered by JetHome