diff options
author | Tian Tao <tiantao6@hisilicon.com> | 2021-02-09 16:03:37 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-03-07 15:13:14 +1100 |
commit | 8fb7bd312fdb7e38261515b53f7dbd2665bda6ad (patch) | |
tree | 138fbc5846268ff2e56887a2ca117e9c057304cc /drivers | |
parent | 6131e970770da0e1d667f96efafd3f859aa4ea74 (diff) |
hwrng: xiphera-trng - 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')
-rw-r--r-- | drivers/char/hw_random/xiphera-trng.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/hw_random/xiphera-trng.c b/drivers/char/hw_random/xiphera-trng.c index 7bdab8c8a6a8..2a9fea72b2e0 100644 --- a/drivers/char/hw_random/xiphera-trng.c +++ b/drivers/char/hw_random/xiphera-trng.c @@ -63,14 +63,12 @@ static int xiphera_trng_probe(struct platform_device *pdev) int ret; struct xiphera_trng *trng; struct device *dev = &pdev->dev; - struct resource *res; trng = devm_kzalloc(dev, sizeof(*trng), GFP_KERNEL); if (!trng) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - trng->mem = devm_ioremap_resource(dev, res); + trng->mem = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(trng->mem)) return PTR_ERR(trng->mem); |