aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/videobuf-dma-sg.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c
index f733833a021e..b49f1e23298a 100644
--- a/drivers/media/video/videobuf-dma-sg.c
+++ b/drivers/media/video/videobuf-dma-sg.c
@@ -279,17 +279,6 @@ int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma)
279} 279}
280EXPORT_SYMBOL_GPL(videobuf_dma_map); 280EXPORT_SYMBOL_GPL(videobuf_dma_map);
281 281
282int videobuf_dma_sync(struct videobuf_queue *q, struct videobuf_dmabuf *dma)
283{
284 MAGIC_CHECK(dma->magic, MAGIC_DMABUF);
285 BUG_ON(!dma->sglen);
286
287 dma_sync_sg_for_cpu(q->dev, dma->sglist, dma->nr_pages, dma->direction);
288
289 return 0;
290}
291EXPORT_SYMBOL_GPL(videobuf_dma_sync);
292
293int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma) 282int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma)
294{ 283{
295 MAGIC_CHECK(dma->magic, MAGIC_DMABUF); 284 MAGIC_CHECK(dma->magic, MAGIC_DMABUF);
@@ -542,10 +531,15 @@ static int __videobuf_sync(struct videobuf_queue *q,
542 struct videobuf_buffer *buf) 531 struct videobuf_buffer *buf)
543{ 532{
544 struct videobuf_dma_sg_memory *mem = buf->priv; 533 struct videobuf_dma_sg_memory *mem = buf->priv;
545 BUG_ON(!mem); 534 BUG_ON(!mem || !mem->dma.sglen);
535
546 MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); 536 MAGIC_CHECK(mem->magic, MAGIC_SG_MEM);
537 MAGIC_CHECK(mem->dma.magic, MAGIC_DMABUF);
547 538
548 return videobuf_dma_sync(q, &mem->dma); 539 dma_sync_sg_for_cpu(q->dev, mem->dma.sglist,
540 mem->dma.nr_pages, mem->dma.direction);
541
542 return 0;
549} 543}
550 544
551static int __videobuf_mmap_mapper(struct videobuf_queue *q, 545static int __videobuf_mmap_mapper(struct videobuf_queue *q,