Commit 32f91bb3 authored by Yangtao Li's avatar Yangtao Li Committed by Herbert Xu

crypto: atmel-tdes - Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent f069fa9d
...@@ -1172,11 +1172,9 @@ static int atmel_tdes_probe(struct platform_device *pdev) ...@@ -1172,11 +1172,9 @@ static int atmel_tdes_probe(struct platform_device *pdev)
crypto_init_queue(&tdes_dd->queue, ATMEL_TDES_QUEUE_LENGTH); crypto_init_queue(&tdes_dd->queue, ATMEL_TDES_QUEUE_LENGTH);
/* Get the base address */ tdes_dd->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, &tdes_res);
tdes_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (IS_ERR(tdes_dd->io_base)) {
if (!tdes_res) { err = PTR_ERR(tdes_dd->io_base);
dev_err(dev, "no MEM resource info\n");
err = -ENODEV;
goto err_tasklet_kill; goto err_tasklet_kill;
} }
tdes_dd->phys_base = tdes_res->start; tdes_dd->phys_base = tdes_res->start;
...@@ -1203,12 +1201,6 @@ static int atmel_tdes_probe(struct platform_device *pdev) ...@@ -1203,12 +1201,6 @@ static int atmel_tdes_probe(struct platform_device *pdev)
goto err_tasklet_kill; goto err_tasklet_kill;
} }
tdes_dd->io_base = devm_ioremap_resource(&pdev->dev, tdes_res);
if (IS_ERR(tdes_dd->io_base)) {
err = PTR_ERR(tdes_dd->io_base);
goto err_tasklet_kill;
}
err = atmel_tdes_hw_version_init(tdes_dd); err = atmel_tdes_hw_version_init(tdes_dd);
if (err) if (err)
goto err_tasklet_kill; goto err_tasklet_kill;
......
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