summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/sa2ul.c
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2021-05-14 11:12:45 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2021-05-23 08:52:40 +0800
commitdaeec7388eb2c5dbff17630b76c22786ffa1e55a (patch)
treefc9d0fe417c3fc923204c5f93c60e6a4a6e54fda /drivers/crypto/sa2ul.c
parentd699c5d0bd811e48de72aeeb8e3872c63e957745 (diff)
downloadlinux-stable-daeec7388eb2c5dbff17630b76c22786ffa1e55a.tar.gz
linux-stable-daeec7388eb2c5dbff17630b76c22786ffa1e55a.tar.bz2
linux-stable-daeec7388eb2c5dbff17630b76c22786ffa1e55a.zip
crypto: sa2ul - Use devm_platform_ioremap_resource()
Simplify the platform_get_resource() and devm_ioremap_resource() calls with devm_platform_ioremap_resource(). Also add error checking and move up this block to simplify the cleanup in sa_ul_probe(). Signed-off-by: Suman Anna <s-anna@ti.com> Reviewed-by: Tero Kristo <kristo@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/sa2ul.c')
-rw-r--r--drivers/crypto/sa2ul.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c
index 9f077ec9dbb7..216702fef945 100644
--- a/drivers/crypto/sa2ul.c
+++ b/drivers/crypto/sa2ul.c
@@ -2390,7 +2390,6 @@ static int sa_ul_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *node = dev->of_node;
- struct resource *res;
static void __iomem *saul_base;
struct sa_crypto_data *dev_data;
int ret;
@@ -2403,9 +2402,14 @@ static int sa_ul_probe(struct platform_device *pdev)
if (!dev_data->match_data)
return -ENODEV;
+ saul_base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(saul_base))
+ return PTR_ERR(saul_base);
+
sa_k3_dev = dev;
dev_data->dev = dev;
dev_data->pdev = pdev;
+ dev_data->base = saul_base;
platform_set_drvdata(pdev, dev_data);
dev_set_drvdata(sa_k3_dev, dev_data);
@@ -2424,10 +2428,6 @@ static int sa_ul_probe(struct platform_device *pdev)
goto destroy_dma_pool;
spin_lock_init(&dev_data->scid_lock);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- saul_base = devm_ioremap_resource(dev, res);
-
- dev_data->base = saul_base;
if (!dev_data->match_data->skip_engine_control) {
u32 val = SA_EEC_ENCSS_EN | SA_EEC_AUTHSS_EN | SA_EEC_CTXCACH_EN |