diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-05-11 09:36:30 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 14:21:45 -0400 |
commit | 952684035a91334dbe33b15063514cab5e7c6907 (patch) | |
tree | fbd82c8a9af67ab15369a1f120feafaa8836aa14 /drivers/media/video/videobuf-dma-sg.c | |
parent | a438d6da52b991b6896742a0f9aed80c2f82da87 (diff) |
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 a9b109178578..17b1f89e8133 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, | |||
235 | } | 235 | } |
236 | EXPORT_SYMBOL_GPL(videobuf_dma_init_overlay); | 236 | EXPORT_SYMBOL_GPL(videobuf_dma_init_overlay); |
237 | 237 | ||
238 | int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma) | 238 | int videobuf_dma_map(struct device *dev, struct videobuf_dmabuf *dma) |
239 | { | 239 | { |
240 | MAGIC_CHECK(dma->magic, MAGIC_DMABUF); | 240 | MAGIC_CHECK(dma->magic, MAGIC_DMABUF); |
241 | BUG_ON(0 == dma->nr_pages); | 241 | BUG_ON(0 == dma->nr_pages); |
@@ -263,7 +263,7 @@ int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma) | |||
263 | return -ENOMEM; | 263 | return -ENOMEM; |
264 | } | 264 | } |
265 | if (!dma->bus_addr) { | 265 | if (!dma->bus_addr) { |
266 | dma->sglen = dma_map_sg(q->dev, dma->sglist, | 266 | dma->sglen = dma_map_sg(dev, dma->sglist, |
267 | dma->nr_pages, dma->direction); | 267 | dma->nr_pages, dma->direction); |
268 | if (0 == dma->sglen) { | 268 | if (0 == dma->sglen) { |
269 | printk(KERN_WARNING | 269 | printk(KERN_WARNING |
@@ -279,14 +279,14 @@ int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma) | |||
279 | } | 279 | } |
280 | EXPORT_SYMBOL_GPL(videobuf_dma_map); | 280 | EXPORT_SYMBOL_GPL(videobuf_dma_map); |
281 | 281 | ||
282 | int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma) | 282 | int videobuf_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma) |
283 | { | 283 | { |
284 | MAGIC_CHECK(dma->magic, MAGIC_DMABUF); | 284 | MAGIC_CHECK(dma->magic, MAGIC_DMABUF); |
285 | 285 | ||
286 | if (!dma->sglen) | 286 | if (!dma->sglen) |
287 | return 0; | 287 | return 0; |
288 | 288 | ||
289 | dma_unmap_sg(q->dev, dma->sglist, dma->sglen, dma->direction); | 289 | dma_unmap_sg(dev, dma->sglist, dma->sglen, dma->direction); |
290 | 290 | ||
291 | vfree(dma->sglist); | 291 | vfree(dma->sglist); |
292 | dma->sglist = NULL; | 292 | dma->sglist = NULL; |
@@ -322,28 +322,6 @@ EXPORT_SYMBOL_GPL(videobuf_dma_free); | |||
322 | 322 | ||
323 | /* --------------------------------------------------------------------- */ | 323 | /* --------------------------------------------------------------------- */ |
324 | 324 | ||
325 | int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma) | ||
326 | { | ||
327 | struct videobuf_queue q; | ||
328 | |||
329 | q.dev = dev; | ||
330 | |||
331 | return videobuf_dma_map(&q, dma); | ||
332 | } | ||
333 | EXPORT_SYMBOL_GPL(videobuf_sg_dma_map); | ||
334 | |||
335 | int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma) | ||
336 | { | ||
337 | struct videobuf_queue q; | ||
338 | |||
339 | q.dev = dev; | ||
340 | |||
341 | return videobuf_dma_unmap(&q, dma); | ||
342 | } | ||
343 | EXPORT_SYMBOL_GPL(videobuf_sg_dma_unmap); | ||
344 | |||
345 | /* --------------------------------------------------------------------- */ | ||
346 | |||
347 | static void videobuf_vm_open(struct vm_area_struct *vma) | 325 | static void videobuf_vm_open(struct vm_area_struct *vma) |
348 | { | 326 | { |
349 | struct videobuf_mapping *map = vma->vm_private_data; | 327 | struct videobuf_mapping *map = vma->vm_private_data; |
@@ -520,7 +498,7 @@ static int __videobuf_iolock(struct videobuf_queue *q, | |||
520 | default: | 498 | default: |
521 | BUG(); | 499 | BUG(); |
522 | } | 500 | } |
523 | err = videobuf_dma_map(q, &mem->dma); | 501 | err = videobuf_dma_map(q->dev, &mem->dma); |
524 | if (0 != err) | 502 | if (0 != err) |
525 | return err; | 503 | return err; |
526 | 504 | ||