crypto: exynos - use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Fri, 2 Aug 2019 13:28:00 +0000 (21:28 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Aug 2019 05:11:59 +0000 (15:11 +1000)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/exynos-rng.c

index 2cfabb99cb6ebfb5f9bfea8a595ae29b8b483ec6..cbd8ca6e52ee49e6defec1f9bb1db1eb32f7b2fc 100644 (file)
@@ -268,7 +268,6 @@ static struct rng_alg exynos_rng_alg = {
 static int exynos_rng_probe(struct platform_device *pdev)
 {
        struct exynos_rng_dev *rng;
-       struct resource *res;
        int ret;
 
        if (exynos_rng_dev)
@@ -289,8 +288,7 @@ static int exynos_rng_probe(struct platform_device *pdev)
                return PTR_ERR(rng->clk);
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       rng->mem = devm_ioremap_resource(&pdev->dev, res);
+       rng->mem = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(rng->mem))
                return PTR_ERR(rng->mem);