summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLv Ruyi <lv.ruyi@zte.com.cn>2022-04-18 01:57:00 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2022-04-29 13:44:57 +0800
commitcca806307311bec150268646572ef6a3548ac295 (patch)
treee441d01f6040de7bcfee1756a4cbd467be5926e2
parent05def5cacfa0bd5ba380116046747da07ff5bd78 (diff)
downloadlinux-stable-cca806307311bec150268646572ef6a3548ac295.tar.gz
linux-stable-cca806307311bec150268646572ef6a3548ac295.tar.bz2
linux-stable-cca806307311bec150268646572ef6a3548ac295.zip
crypto: keembay - Make use of devm helper function devm_platform_ioremap_resource()
Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately.Make the code simpler without functional changes. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/keembay/keembay-ocs-aes-core.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/crypto/keembay/keembay-ocs-aes-core.c b/drivers/crypto/keembay/keembay-ocs-aes-core.c
index e2a39fdaf623..9953f5590ac4 100644
--- a/drivers/crypto/keembay/keembay-ocs-aes-core.c
+++ b/drivers/crypto/keembay/keembay-ocs-aes-core.c
@@ -1598,7 +1598,6 @@ static int kmb_ocs_aes_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ocs_aes_dev *aes_dev;
- struct resource *aes_mem;
int rc;
aes_dev = devm_kzalloc(dev, sizeof(*aes_dev), GFP_KERNEL);
@@ -1616,13 +1615,7 @@ static int kmb_ocs_aes_probe(struct platform_device *pdev)
}
/* Get base register address. */
- aes_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!aes_mem) {
- dev_err(dev, "Could not retrieve io mem resource\n");
- return -ENODEV;
- }
-
- aes_dev->base_reg = devm_ioremap_resource(&pdev->dev, aes_mem);
+ aes_dev->base_reg = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(aes_dev->base_reg))
return PTR_ERR(aes_dev->base_reg);