diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-05-11 10:36:30 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 15:21:45 -0300 |
commit | 952684035a91334dbe33b15063514cab5e7c6907 (patch) | |
tree | fbd82c8a9af67ab15369a1f120feafaa8836aa14 /drivers/media/video/videobuf-dma-sg.c | |
parent | a438d6da52b991b6896742a0f9aed80c2f82da87 (diff) | |
download | op-kernel-dev-952684035a91334dbe33b15063514cab5e7c6907.zip op-kernel-dev-952684035a91334dbe33b15063514cab5e7c6907.tar.gz |
V4L/DVB: videobuf: Remove the videobuf_sg_dma_map/unmap functions
Instead of creating dirty wrappers around videobuf_dma_map/unmap that
create a dummy videobuf_queue structure, modify videobuf_dma_map/unmap
to take a device pointer argument and use it directly. The
videobuf_sg_dma_map/unmap then become unused and can be removed.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/videobuf-dma-sg.c')
-rw-r--r-- | drivers/media/video/videobuf-dma-sg.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index a9b1091..17b1f89 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c @@ -235,7 +235,7 @@ int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction, } EXPORT_SYMBOL_GPL(videobuf_dma_init_overlay); -int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma) +int videobuf_dma_map(struct device *dev, struct videobuf_dmabuf *dma) { MAGIC_CHECK(dma->magic, MAGIC_DMABUF); BUG_ON(0 == dma->nr_pages); @@ -263,7 +263,7 @@ int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma) return -ENOMEM; } if (!dma->bus_addr) { - dma->sglen = dma_map_sg(q->dev, dma->sglist, + dma->sglen = dma_map_sg(dev, dma->sglist, dma->nr_pages, dma->direction); if (0 == dma->sglen) { printk(KERN_WARNING @@ -279,14 +279,14 @@ int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma) } EXPORT_SYMBOL_GPL(videobuf_dma_map); -int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma) +int videobuf_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma) { MAGIC_CHECK(dma->magic, MAGIC_DMABUF); if (!dma->sglen) return 0; - dma_unmap_sg(q->dev, dma->sglist, dma->sglen, dma->direction); + dma_unmap_sg(dev, dma->sglist, dma->sglen, dma->direction); vfree(dma->sglist); dma->sglist = NULL; @@ -322,28 +322,6 @@ EXPORT_SYMBOL_GPL(videobuf_dma_free); /* --------------------------------------------------------------------- */ -int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma) -{ - struct videobuf_queue q; - - q.dev = dev; - - return videobuf_dma_map(&q, dma); -} -EXPORT_SYMBOL_GPL(videobuf_sg_dma_map); - -int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma) -{ - struct videobuf_queue q; - - q.dev = dev; - - return videobuf_dma_unmap(&q, dma); -} -EXPORT_SYMBOL_GPL(videobuf_sg_dma_unmap); - -/* --------------------------------------------------------------------- */ - static void videobuf_vm_open(struct vm_area_struct *vma) { struct videobuf_mapping *map = vma->vm_private_data; @@ -520,7 +498,7 @@ static int __videobuf_iolock(struct videobuf_queue *q, default: BUG(); } - err = videobuf_dma_map(q, &mem->dma); + err = videobuf_dma_map(q->dev, &mem->dma); if (0 != err) return err; |