The patch number 14697 was added via Douglas Schilling Landgraf 
<[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <[email protected]>

------

From: Hans Verkuil  <[email protected]>
v4l videobuf: remove mmap_free callback


Remove the mmap_free callback from struct videobuf_qtype_ops.

All implementations of this callback do the same trivial check: return
-EBUSY if any buffer is mmapped. That can also be tested in the
videobuf core.

Priority: normal

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Douglas Schilling Landgraf <[email protected]>


---

 linux/drivers/media/video/videobuf-core.c       |   10 ++++------
 linux/drivers/media/video/videobuf-dma-contig.c |   14 --------------
 linux/drivers/media/video/videobuf-dma-sg.c     |   15 ---------------
 linux/drivers/media/video/videobuf-vmalloc.c    |   16 ----------------
 linux/include/media/videobuf-core.h             |    1 -
 5 files changed, 4 insertions(+), 52 deletions(-)

diff -r f3a35d98b8e1 -r 7ad62393f81e linux/drivers/media/video/videobuf-core.c
--- a/linux/drivers/media/video/videobuf-core.c Mon May 10 01:51:36 2010 -0300
+++ b/linux/drivers/media/video/videobuf-core.c Mon May 10 01:54:14 2010 -0300
@@ -312,20 +312,18 @@
 static int __videobuf_mmap_free(struct videobuf_queue *q)
 {
        int i;
-       int rc;
 
        if (!q)
                return 0;
 
        MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
 
-       rc = CALL(q, mmap_free, q);
+       for (i = 0; i < VIDEO_MAX_FRAME; i++)
+               if (q->bufs[i] && q->bufs[i]->map)
+                       return -EBUSY;
 
        q->is_mmapped = 0;
 
-       if (rc < 0)
-               return rc;
-
        for (i = 0; i < VIDEO_MAX_FRAME; i++) {
                if (NULL == q->bufs[i])
                        continue;
@@ -334,7 +332,7 @@
                q->bufs[i] = NULL;
        }
 
-       return rc;
+       return 0;
 }
 
 int videobuf_mmap_free(struct videobuf_queue *q)
diff -r f3a35d98b8e1 -r 7ad62393f81e 
linux/drivers/media/video/videobuf-dma-contig.c
--- a/linux/drivers/media/video/videobuf-dma-contig.c   Mon May 10 01:51:36 
2010 -0300
+++ b/linux/drivers/media/video/videobuf-dma-contig.c   Mon May 10 01:54:14 
2010 -0300
@@ -267,19 +267,6 @@
        return 0;
 }
 
-static int __videobuf_mmap_free(struct videobuf_queue *q)
-{
-       unsigned int i;
-
-       dev_dbg(q->dev, "%s\n", __func__);
-       for (i = 0; i < VIDEO_MAX_FRAME; i++) {
-               if (q->bufs[i] && q->bufs[i]->map)
-                       return -EBUSY;
-       }
-
-       return 0;
-}
-
 static int __videobuf_mmap_mapper(struct videobuf_queue *q,
                                  struct vm_area_struct *vma)
 {
@@ -428,7 +415,6 @@
 
        .alloc        = __videobuf_alloc,
        .iolock       = __videobuf_iolock,
-       .mmap_free    = __videobuf_mmap_free,
        .mmap_mapper  = __videobuf_mmap_mapper,
        .video_copy_to_user = __videobuf_copy_to_user,
        .copy_stream  = __videobuf_copy_stream,
diff -r f3a35d98b8e1 -r 7ad62393f81e linux/drivers/media/video/videobuf-dma-sg.c
--- a/linux/drivers/media/video/videobuf-dma-sg.c       Mon May 10 01:51:36 
2010 -0300
+++ b/linux/drivers/media/video/videobuf-dma-sg.c       Mon May 10 01:54:14 
2010 -0300
@@ -583,20 +583,6 @@
        return videobuf_dma_sync(q, &mem->dma);
 }
 
-static int __videobuf_mmap_free(struct videobuf_queue *q)
-{
-       int i;
-
-       for (i = 0; i < VIDEO_MAX_FRAME; i++) {
-               if (q->bufs[i]) {
-                       if (q->bufs[i]->map)
-                               return -EBUSY;
-               }
-       }
-
-       return 0;
-}
-
 static int __videobuf_mmap_mapper(struct videobuf_queue *q,
                         struct vm_area_struct *vma)
 {
@@ -746,7 +732,6 @@
        .alloc        = __videobuf_alloc,
        .iolock       = __videobuf_iolock,
        .sync         = __videobuf_sync,
-       .mmap_free    = __videobuf_mmap_free,
        .mmap_mapper  = __videobuf_mmap_mapper,
        .video_copy_to_user = __videobuf_copy_to_user,
        .copy_stream  = __videobuf_copy_stream,
diff -r f3a35d98b8e1 -r 7ad62393f81e 
linux/drivers/media/video/videobuf-vmalloc.c
--- a/linux/drivers/media/video/videobuf-vmalloc.c      Mon May 10 01:51:36 
2010 -0300
+++ b/linux/drivers/media/video/videobuf-vmalloc.c      Mon May 10 01:54:14 
2010 -0300
@@ -240,21 +240,6 @@
        return 0;
 }
 
-static int __videobuf_mmap_free(struct videobuf_queue *q)
-{
-       unsigned int i;
-
-       dprintk(1, "%s\n", __func__);
-       for (i = 0; i < VIDEO_MAX_FRAME; i++) {
-               if (q->bufs[i]) {
-                       if (q->bufs[i]->map)
-                               return -EBUSY;
-               }
-       }
-
-       return 0;
-}
-
 static int __videobuf_mmap_mapper(struct videobuf_queue *q,
                         struct vm_area_struct *vma)
 {
@@ -390,7 +375,6 @@
        .alloc        = __videobuf_alloc,
        .iolock       = __videobuf_iolock,
        .sync         = __videobuf_sync,
-       .mmap_free    = __videobuf_mmap_free,
        .mmap_mapper  = __videobuf_mmap_mapper,
        .video_copy_to_user = __videobuf_copy_to_user,
        .copy_stream  = __videobuf_copy_stream,
diff -r f3a35d98b8e1 -r 7ad62393f81e linux/include/media/videobuf-core.h
--- a/linux/include/media/videobuf-core.h       Mon May 10 01:51:36 2010 -0300
+++ b/linux/include/media/videobuf-core.h       Mon May 10 01:54:14 2010 -0300
@@ -144,7 +144,6 @@
                                 size_t pos,
                                 int vbihack,
                                 int nonblocking);
-       int (*mmap_free)        (struct videobuf_queue *q);
        int (*mmap_mapper)      (struct videobuf_queue *q,
                                struct vm_area_struct *vma);
 };


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/7ad62393f81ee19efeb084d3c3b4f7885593928a

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to