diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-05 15:21:57 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-07-20 22:16:25 +1200 |
commit | f069fa9d789d908e21350fcfb6a34271a3f2d9b6 (patch) | |
tree | d3a79af7827b6ec61efeb3bc11fee8ba6af6152f /drivers/crypto/atmel-sha.c | |
parent | 3aaafe054b7140418c9355512bc1a7a4980943c3 (diff) | |
download | linux-f069fa9d789d908e21350fcfb6a34271a3f2d9b6.tar.gz linux-f069fa9d789d908e21350fcfb6a34271a3f2d9b6.tar.bz2 linux-f069fa9d789d908e21350fcfb6a34271a3f2d9b6.zip |
crypto: atmel-sha - 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: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-sha.c')
-rw-r--r-- | drivers/crypto/atmel-sha.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c index 6bef634d3c86..f2031f934be9 100644 --- a/drivers/crypto/atmel-sha.c +++ b/drivers/crypto/atmel-sha.c @@ -2604,11 +2604,9 @@ static int atmel_sha_probe(struct platform_device *pdev) crypto_init_queue(&sha_dd->queue, ATMEL_SHA_QUEUE_LENGTH); - /* Get the base address */ - sha_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!sha_res) { - dev_err(dev, "no MEM resource info\n"); - err = -ENODEV; + sha_dd->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, &sha_res); + if (IS_ERR(sha_dd->io_base)) { + err = PTR_ERR(sha_dd->io_base); goto err_tasklet_kill; } sha_dd->phys_base = sha_res->start; @@ -2635,13 +2633,6 @@ static int atmel_sha_probe(struct platform_device *pdev) goto err_tasklet_kill; } - sha_dd->io_base = devm_ioremap_resource(&pdev->dev, sha_res); - if (IS_ERR(sha_dd->io_base)) { - dev_err(dev, "can't ioremap\n"); - err = PTR_ERR(sha_dd->io_base); - goto err_tasklet_kill; - } - err = clk_prepare(sha_dd->iclk); if (err) goto err_tasklet_kill; |