diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-10-16 18:46:10 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-10-26 02:09:53 +1100 |
commit | 3e46bd34970632cdd948669c2fc8c9e8ace0c738 (patch) | |
tree | d28009dd9074ae846d99a1dc0a95ffd3750681e5 /drivers/char/hw_random/bcm2835-rng.c | |
parent | bc49534db6949cb71dd602d82481c0a2fdd44b05 (diff) | |
download | linux-3e46bd34970632cdd948669c2fc8c9e8ace0c738.tar.bz2 |
hwrng: bcm2835 - use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random/bcm2835-rng.c')
-rw-r--r-- | drivers/char/hw_random/bcm2835-rng.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c index f759790c3cdb..d2a5791eb49f 100644 --- a/drivers/char/hw_random/bcm2835-rng.c +++ b/drivers/char/hw_random/bcm2835-rng.c @@ -142,7 +142,6 @@ static int bcm2835_rng_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; const struct of_device_id *rng_id; struct bcm2835_rng_priv *priv; - struct resource *r; int err; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -151,10 +150,8 @@ static int bcm2835_rng_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - /* map peripheral */ - priv->base = devm_ioremap_resource(dev, r); + priv->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) return PTR_ERR(priv->base); |