diff options
author | Jingoo Han <jg1.han@samsung.com> | 2014-02-12 00:19:48 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-02-26 16:56:51 -0500 |
commit | fb5d23e3e09d6c9719b783ac1955c085aca3d4ae (patch) | |
tree | 03f0b9ec3f81602ae0cfd24f622539051eca9ef6 /drivers/char/hw_random/picoxcell-rng.c | |
parent | bfaff75b09c42d8fc57b020034e836fe9048f8b1 (diff) |
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/picoxcell-rng.c')
-rw-r--r-- | drivers/char/hw_random/picoxcell-rng.c | 19 |
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) | |||
104 | int ret; | 104 | int ret; |
105 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 105 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
106 | 106 | ||
107 | if (!mem) { | 107 | rng_base = devm_ioremap_resource(&pdev->dev, mem); |
108 | dev_warn(&pdev->dev, "no memory resource\n"); | 108 | if (IS_ERR(rng_base)) |
109 | return -ENOMEM; | 109 | return PTR_ERR(rng_base); |
110 | } | ||
111 | |||
112 | if (!devm_request_mem_region(&pdev->dev, mem->start, resource_size(mem), | ||
113 | "picoxcell_trng")) { | ||
114 | dev_warn(&pdev->dev, "unable to request io mem\n"); | ||
115 | return -EBUSY; | ||
116 | } | ||
117 | |||
118 | rng_base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); | ||
119 | if (!rng_base) { | ||
120 | dev_warn(&pdev->dev, "unable to remap io mem\n"); | ||
121 | return -ENOMEM; | ||
122 | } | ||
123 | 110 | ||
124 | rng_clk = clk_get(&pdev->dev, NULL); | 111 | rng_clk = clk_get(&pdev->dev, NULL); |
125 | if (IS_ERR(rng_clk)) { | 112 | if (IS_ERR(rng_clk)) { |