diff options
Diffstat (limited to 'drivers/media/video/videobuf-dma-sg.c')
-rw-r--r-- | drivers/media/video/videobuf-dma-sg.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index 20f227ee2b3..ddb8f4b46c0 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c @@ -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; |