[media] videobuf-dma-contig: use vm_iomap_memory()
authorMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 17 Apr 2013 11:22:16 +0000 (08:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 21 May 2013 12:22:12 +0000 (09:22 -0300)
vm_iomap_memory() provides a better end user interface than
remap_pfn_range(), as it does the needed tests before doing
mmap.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/videobuf-dma-contig.c

index 8204c881037255300a4658f1769b6f8f90034d05..65411adcd0ea958a3b4c7a5edd6f4f2d57cb32d9 100644 (file)
@@ -305,14 +305,9 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q,
                goto error;
 
        /* Try to remap memory */
-
        size = vma->vm_end - vma->vm_start;
-       size = (size < mem->size) ? size : mem->size;
-
        vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-       retval = remap_pfn_range(vma, vma->vm_start,
-                                mem->dma_handle >> PAGE_SHIFT,
-                                size, vma->vm_page_prot);
+       retval = vm_iomap_memory(vma, vma->vm_start, size);
        if (retval) {
                dev_err(q->dev, "mmap: remap failed with error %d. ",
                        retval);