summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-10-16 18:46:09 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2019-10-26 02:09:53 +1100
commitbc49534db6949cb71dd602d82481c0a2fdd44b05 (patch)
tree4b3fb325e9b43de04a49a163481e5bdd14094ca8 /drivers/char
parentd1569349d7ce540606bbe8c1e6a5b16b1fd45e34 (diff)
hwrng: atmel - 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: Ludovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/atmel-rng.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index e55705745d5e..b3138ec26f85 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -62,15 +62,13 @@ static void atmel_trng_disable(struct atmel_trng *trng)
static int atmel_trng_probe(struct platform_device *pdev)
{
struct atmel_trng *trng;
- struct resource *res;
int ret;
trng = devm_kzalloc(&pdev->dev, sizeof(*trng), GFP_KERNEL);
if (!trng)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- trng->base = devm_ioremap_resource(&pdev->dev, res);
+ trng->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(trng->base))
return PTR_ERR(trng->base);