Commit a68b9319 authored by Markus Elfring's avatar Markus Elfring Committed by Herbert Xu

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Reviewed-by: default avatarRay Jui <ray.jui@broadcom.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 946a4a2a
...@@ -181,7 +181,6 @@ static void iproc_rng200_cleanup(struct hwrng *rng) ...@@ -181,7 +181,6 @@ static void iproc_rng200_cleanup(struct hwrng *rng)
static int iproc_rng200_probe(struct platform_device *pdev) static int iproc_rng200_probe(struct platform_device *pdev)
{ {
struct iproc_rng200_dev *priv; struct iproc_rng200_dev *priv;
struct resource *res;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int ret; int ret;
...@@ -190,13 +189,7 @@ static int iproc_rng200_probe(struct platform_device *pdev) ...@@ -190,13 +189,7 @@ static int iproc_rng200_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
/* Map peripheral */ /* Map peripheral */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->base = devm_platform_ioremap_resource(pdev, 0);
if (!res) {
dev_err(dev, "failed to get rng resources\n");
return -EINVAL;
}
priv->base = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->base)) { if (IS_ERR(priv->base)) {
dev_err(dev, "failed to remap rng regs\n"); dev_err(dev, "failed to remap rng regs\n");
return PTR_ERR(priv->base); return PTR_ERR(priv->base);
......
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