summaryrefslogtreecommitdiff
path: root/drivers/char/hw_random
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-03-13 09:47:38 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-03-19 21:59:46 +1100
commit682689a56e3b01c64ff6fab7884d94b02be2ab1c (patch)
treed70a31954cd08cd36ccc3b6a49beec2ce74c024f /drivers/char/hw_random
parentf50281df94d76d40e8afa2433f39c7b4b8bd6868 (diff)
hwrng: ba431 - use devm_platform_ioremap_resource() to simplify
Use devm_platform_ioremap_resource() to simplify the code. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r--drivers/char/hw_random/ba431-rng.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c
index 4f514e24c79b..5b7ca0416490 100644
--- a/drivers/char/hw_random/ba431-rng.c
+++ b/drivers/char/hw_random/ba431-rng.c
@@ -170,7 +170,6 @@ static int ba431_trng_init(struct hwrng *rng)
static int ba431_trng_probe(struct platform_device *pdev)
{
struct ba431_trng *ba431;
- struct resource *res;
int ret;
ba431 = devm_kzalloc(&pdev->dev, sizeof(*ba431), GFP_KERNEL);
@@ -179,8 +178,7 @@ static int ba431_trng_probe(struct platform_device *pdev)
ba431->dev = &pdev->dev;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- ba431->base = devm_ioremap_resource(&pdev->dev, res);
+ ba431->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(ba431->base))
return PTR_ERR(ba431->base);