crypto: qcom-rng - use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Fri, 2 Aug 2019 13:28:09 +0000 (21:28 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 9 Aug 2019 05:12:03 +0000 (15:12 +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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qcom-rng.c

index e54249ccc009202973fcbaf4635ac563ab174cbf..4730f84b646dee0dae99bb3378352c4a529840ac 100644 (file)
@@ -153,7 +153,6 @@ static struct rng_alg qcom_rng_alg = {
 
 static int qcom_rng_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        struct qcom_rng *rng;
        int ret;
 
@@ -164,8 +163,7 @@ static int qcom_rng_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, rng);
        mutex_init(&rng->lock);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       rng->base = devm_ioremap_resource(&pdev->dev, res);
+       rng->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(rng->base))
                return PTR_ERR(rng->base);