summaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/iproc-rng200.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-09-18 09:09:22 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2019-10-05 01:06:17 +1000
commita68b931932c5574aa5bd459529c766ba577c72b3 (patch)
treea8537c4261b1b09f36b135302363469bc52fb9ed /drivers/char/hw_random/iproc-rng200.c
parent946a4a2a49195e2d45c71fcb0d887fc1b3fad567 (diff)
downloadlinux-a68b931932c5574aa5bd459529c766ba577c72b3.tar.bz2
hwrng: iproc-rng200 - Use devm_platform_ioremap_resource() in iproc_rng200_probe()
Simplify this function implementation by using a known wrapper function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Ray Jui <ray.jui@broadcom.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random/iproc-rng200.c')
-rw-r--r--drivers/char/hw_random/iproc-rng200.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/char/hw_random/iproc-rng200.c b/drivers/char/hw_random/iproc-rng200.c
index 92be1c0ab99f..899ff25f4f28 100644
--- a/drivers/char/hw_random/iproc-rng200.c
+++ b/drivers/char/hw_random/iproc-rng200.c
@@ -181,7 +181,6 @@ static void iproc_rng200_cleanup(struct hwrng *rng)
static int iproc_rng200_probe(struct platform_device *pdev)
{
struct iproc_rng200_dev *priv;
- struct resource *res;
struct device *dev = &pdev->dev;
int ret;
@@ -190,13 +189,7 @@ static int iproc_rng200_probe(struct platform_device *pdev)
return -ENOMEM;
/* Map peripheral */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(dev, "failed to get rng resources\n");
- return -EINVAL;
- }
-
- priv->base = devm_ioremap_resource(dev, res);
+ priv->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(priv->base)) {
dev_err(dev, "failed to remap rng regs\n");
return PTR_ERR(priv->base);