Commit fb5d23e3 authored by Jingoo Han's avatar Jingoo Han Committed by Herbert Xu

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: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent bfaff75b
...@@ -104,22 +104,9 @@ static int picoxcell_trng_probe(struct platform_device *pdev) ...@@ -104,22 +104,9 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
int ret; int ret;
struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) { rng_base = devm_ioremap_resource(&pdev->dev, mem);
dev_warn(&pdev->dev, "no memory resource\n"); if (IS_ERR(rng_base))
return -ENOMEM; return PTR_ERR(rng_base);
}
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_clk = clk_get(&pdev->dev, NULL); rng_clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(rng_clk)) { if (IS_ERR(rng_clk)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment