diff options
author | Rosen Penev <rosenp@gmail.com> | 2024-10-10 21:45:17 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2024-10-19 02:44:30 +0200 |
commit | b140bbf7c9067df1933865c0c9f790d868ad269a (patch) | |
tree | 80dc1a56bc27a8d99ffddc5af7a3ddedf99c5d13 | |
parent | crypto: cesa - remove irq_set_affinity_hint (diff) | |
download | linux-b140bbf7c9067df1933865c0c9f790d868ad269a.tar.xz linux-b140bbf7c9067df1933865c0c9f790d868ad269a.zip |
crypto: cesa - use devm_platform_get_and_ioremap_resource
Removes separate steps. Requires index instead of name.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/marvell/cesa/cesa.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c index 30f6ee99a8f8..fa08f10e6f3f 100644 --- a/drivers/crypto/marvell/cesa/cesa.c +++ b/drivers/crypto/marvell/cesa/cesa.c @@ -375,7 +375,6 @@ static int mv_cesa_get_sram(struct platform_device *pdev, int idx) { struct mv_cesa_dev *cesa = platform_get_drvdata(pdev); struct mv_cesa_engine *engine = &cesa->engines[idx]; - const char *res_name = "sram"; struct resource *res; engine->pool = of_gen_pool_get(cesa->dev->of_node, @@ -391,19 +390,7 @@ static int mv_cesa_get_sram(struct platform_device *pdev, int idx) return -ENOMEM; } - if (cesa->caps->nengines > 1) { - if (!idx) - res_name = "sram0"; - else - res_name = "sram1"; - } - - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, - res_name); - if (!res || resource_size(res) < cesa->sram_size) - return -EINVAL; - - engine->sram = devm_ioremap_resource(cesa->dev, res); + engine->sram = devm_platform_get_and_ioremap_resource(pdev, idx, &res); if (IS_ERR(engine->sram)) return PTR_ERR(engine->sram); |