Commit 2ea376a3 authored by Boris BREZILLON's avatar Boris BREZILLON Committed by Herbert Xu

crypto: mv_cesa - request registers memory region

The mv_cesa driver does not request the CESA registers memory region.
Since we're about to add a new CESA driver, we need to make sure only one
of these drivers probe the CESA device, and requesting the registers memory
region is a good way to achieve that.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent a5a22e57
...@@ -1041,23 +1041,23 @@ static int mv_probe(struct platform_device *pdev) ...@@ -1041,23 +1041,23 @@ static int mv_probe(struct platform_device *pdev)
spin_lock_init(&cp->lock); spin_lock_init(&cp->lock);
crypto_init_queue(&cp->queue, 50); crypto_init_queue(&cp->queue, 50);
cp->reg = ioremap(res->start, resource_size(res)); cp->reg = devm_ioremap_resource(&pdev->dev, res);
if (!cp->reg) { if (IS_ERR(cp->reg)) {
ret = -ENOMEM; ret = PTR_ERR(cp->reg);
goto err; goto err;
} }
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sram"); res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sram");
if (!res) { if (!res) {
ret = -ENXIO; ret = -ENXIO;
goto err_unmap_reg; goto err;
} }
cp->sram_size = resource_size(res); cp->sram_size = resource_size(res);
cp->max_req_size = cp->sram_size - SRAM_CFG_SPACE; cp->max_req_size = cp->sram_size - SRAM_CFG_SPACE;
cp->sram = ioremap(res->start, cp->sram_size); cp->sram = ioremap(res->start, cp->sram_size);
if (!cp->sram) { if (!cp->sram) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_unmap_reg; goto err;
} }
if (pdev->dev.of_node) if (pdev->dev.of_node)
...@@ -1136,8 +1136,6 @@ static int mv_probe(struct platform_device *pdev) ...@@ -1136,8 +1136,6 @@ static int mv_probe(struct platform_device *pdev)
kthread_stop(cp->queue_th); kthread_stop(cp->queue_th);
err_unmap_sram: err_unmap_sram:
iounmap(cp->sram); iounmap(cp->sram);
err_unmap_reg:
iounmap(cp->reg);
err: err:
kfree(cp); kfree(cp);
cpg = NULL; cpg = NULL;
...@@ -1158,7 +1156,6 @@ static int mv_remove(struct platform_device *pdev) ...@@ -1158,7 +1156,6 @@ static int mv_remove(struct platform_device *pdev)
free_irq(cp->irq, cp); free_irq(cp->irq, cp);
memset(cp->sram, 0, cp->sram_size); memset(cp->sram, 0, cp->sram_size);
iounmap(cp->sram); iounmap(cp->sram);
iounmap(cp->reg);
if (!IS_ERR(cp->clk)) { if (!IS_ERR(cp->clk)) {
clk_disable_unprepare(cp->clk); clk_disable_unprepare(cp->clk);
......
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