Skip to content

Commit

Permalink
hwrng: iproc-rng200 - Use devm_platform_ioremap_resource() in iproc_r…
Browse files Browse the repository at this point in the history
…ng200_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 <[email protected]>
Reviewed-by: Ray Jui <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
elfring authored and herbertx committed Oct 4, 2019
1 parent 946a4a2 commit a68b931
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/char/hw_random/iproc-rng200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit a68b931

Please sign in to comment.