Commit 2229c740 authored by YueHaibing's avatar YueHaibing Committed by Herbert Xu

crypto: qcom-rng - use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent a54d83d4
...@@ -153,7 +153,6 @@ static struct rng_alg qcom_rng_alg = { ...@@ -153,7 +153,6 @@ static struct rng_alg qcom_rng_alg = {
static int qcom_rng_probe(struct platform_device *pdev) static int qcom_rng_probe(struct platform_device *pdev)
{ {
struct resource *res;
struct qcom_rng *rng; struct qcom_rng *rng;
int ret; int ret;
...@@ -164,8 +163,7 @@ static int qcom_rng_probe(struct platform_device *pdev) ...@@ -164,8 +163,7 @@ static int qcom_rng_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rng); platform_set_drvdata(pdev, rng);
mutex_init(&rng->lock); mutex_init(&rng->lock);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); rng->base = devm_platform_ioremap_resource(pdev, 0);
rng->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(rng->base)) if (IS_ERR(rng->base))
return PTR_ERR(rng->base); return PTR_ERR(rng->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment