]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/media/video/videobuf-dma-sg.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / media / video / videobuf-dma-sg.c
index 20f227ee2b3e63cf58d10ef621665a4df18764fd..ddb8f4b46c03bacea044ec9395adefdcee69350d 100644 (file)
@@ -69,10 +69,9 @@ static struct scatterlist *videobuf_vmalloc_to_sg(unsigned char *virt,
        struct page *pg;
        int i;
 
-       sglist = vmalloc(nr_pages * sizeof(*sglist));
+       sglist = vzalloc(nr_pages * sizeof(*sglist));
        if (NULL == sglist)
                return NULL;
-       memset(sglist, 0, nr_pages * sizeof(*sglist));
        sg_init_table(sglist, nr_pages);
        for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
                pg = vmalloc_to_page(virt);
@@ -544,14 +543,6 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q,
 
        retval = -EINVAL;
 
-       /* This function maintains backwards compatibility with V4L1 and will
-        * map more than one buffer if the vma length is equal to the combined
-        * size of multiple buffers than it will map them together.  See
-        * VIDIOCGMBUF in the v4l spec
-        *
-        * TODO: Allow drivers to specify if they support this mode
-        */
-
        BUG_ON(!mem);
        MAGIC_CHECK(mem->magic, MAGIC_SG_MEM);
 
@@ -571,29 +562,6 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q,
        }
 
        last = first;
-#ifdef CONFIG_VIDEO_V4L1_COMPAT
-       if (size != (vma->vm_end - vma->vm_start)) {
-               /* look for last buffer to map */
-               for (last = first + 1; last < VIDEO_MAX_FRAME; last++) {
-                       if (NULL == q->bufs[last])
-                               continue;
-                       if (V4L2_MEMORY_MMAP != q->bufs[last]->memory)
-                               continue;
-                       if (q->bufs[last]->map) {
-                               retval = -EBUSY;
-                               goto done;
-                       }
-                       size += PAGE_ALIGN(q->bufs[last]->bsize);
-                       if (size == (vma->vm_end - vma->vm_start))
-                               break;
-               }
-               if (VIDEO_MAX_FRAME == last) {
-                       dprintk(1, "mmap app bug: size invalid [size=0x%lx]\n",
-                                       (vma->vm_end - vma->vm_start));
-                       goto done;
-               }
-       }
-#endif
 
        /* create mapping + update buffer list */
        retval = -ENOMEM;