Use devm_ioremap() and simplify the code.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
if (pool->cpumap)
dma_free_coherent(ctlr->dev, pool->mem_size, pool->cpumap,
pool->phys);
- else
- iounmap(pool->iomap);
}
/*
if (cpdma_params->desc_mem_phys) {
pool->phys = cpdma_params->desc_mem_phys;
- pool->iomap = ioremap(pool->phys, pool->mem_size);
+ pool->iomap = devm_ioremap(ctlr->dev, pool->phys,
+ pool->mem_size);
pool->hw_addr = cpdma_params->desc_hw_addr;
} else {
pool->cpumap = dma_alloc_coherent(ctlr->dev, pool->mem_size,