Commit daeec738 authored by Suman Anna's avatar Suman Anna Committed by Herbert Xu

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: default avatarSuman Anna <s-anna@ti.com>
Reviewed-by: default avatarTero Kristo <kristo@kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent d699c5d0
......@@ -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 |
......
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