[media] omap3isp: stat: Merge dma_addr and iommu_addr fields
The fields store buffer addresses as seen from the device. The first one
is used with an external DMA engine while the second one is used with
the ISP DMA engine. As they're never used together, merge them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
diff --git a/drivers/media/platform/omap3isp/ispstat.c b/drivers/media/platform/omap3isp/ispstat.c
index b1eb902..dba713f 100644
--- a/drivers/media/platform/omap3isp/ispstat.c
+++ b/drivers/media/platform/omap3isp/ispstat.c
@@ -361,21 +361,19 @@
struct ispstat_buffer *buf = &stat->buf[i];
if (!ISP_STAT_USES_DMAENGINE(stat)) {
- if (IS_ERR_OR_NULL((void *)buf->iommu_addr))
+ if (IS_ERR_OR_NULL((void *)buf->dma_addr))
continue;
if (buf->iovm)
dma_unmap_sg(isp->dev, buf->iovm->sgt->sgl,
buf->iovm->sgt->nents,
DMA_FROM_DEVICE);
- omap_iommu_vfree(isp->domain, isp->dev,
- buf->iommu_addr);
+ omap_iommu_vfree(isp->domain, isp->dev, buf->dma_addr);
} else {
if (!buf->virt_addr)
continue;
dma_free_coherent(stat->isp->dev, stat->buf_alloc_size,
buf->virt_addr, buf->dma_addr);
}
- buf->iommu_addr = 0;
buf->iovm = NULL;
buf->dma_addr = 0;
buf->virt_addr = NULL;
@@ -396,12 +394,12 @@
struct isp_device *isp = stat->isp;
struct iovm_struct *iovm;
- buf->iommu_addr = omap_iommu_vmalloc(isp->domain, isp->dev, 0,
- size, IOMMU_FLAG);
- if (IS_ERR((void *)buf->iommu_addr))
+ buf->dma_addr = omap_iommu_vmalloc(isp->domain, isp->dev, 0,
+ size, IOMMU_FLAG);
+ if (IS_ERR_VALUE(buf->dma_addr))
return -ENOMEM;
- iovm = omap_find_iovm_area(isp->dev, buf->iommu_addr);
+ iovm = omap_find_iovm_area(isp->dev, buf->dma_addr);
if (!iovm)
return -ENOMEM;
@@ -410,8 +408,7 @@
return -ENOMEM;
buf->iovm = iovm;
- buf->virt_addr = omap_da_to_va(stat->isp->dev,
- (u32)buf->iommu_addr);
+ buf->virt_addr = omap_da_to_va(stat->isp->dev, buf->dma_addr);
return 0;
}
@@ -478,8 +475,8 @@
buf->empty = 1;
dev_dbg(stat->isp->dev,
- "%s: buffer[%u] allocated. iommu=0x%08lx dma=0x%08lx virt=0x%08lx",
- stat->subdev.name, i, buf->iommu_addr,
+ "%s: buffer[%u] allocated. dma=0x%08lx virt=0x%08lx",
+ stat->subdev.name, i,
(unsigned long)buf->dma_addr,
(unsigned long)buf->virt_addr);
}