summaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2014-02-12 14:19:48 +0900
committerHerbert Xu <herbert@gondor.apana.org.au>2014-02-27 05:56:51 +0800
commitfb5d23e3e09d6c9719b783ac1955c085aca3d4ae (patch)
tree03f0b9ec3f81602ae0cfd24f622539051eca9ef6 /drivers/char/hw_random
parentbfaff75b09c42d8fc57b020034e836fe9048f8b1 (diff)
downloadtalos-obmc-linux-fb5d23e3e09d6c9719b783ac1955c085aca3d4ae.tar.gz
talos-obmc-linux-fb5d23e3e09d6c9719b783ac1955c085aca3d4ae.zip
hwrng: pixocell - Use devm_ioremap_resource()
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> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r--drivers/char/hw_random/picoxcell-rng.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/char/hw_random/picoxcell-rng.c b/drivers/char/hw_random/picoxcell-rng.c
index 3d4c2293c6f5..c03beeeb1aea 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)) {
OpenPOWER on IntegriCloud