summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core/videobuf-dma-contig.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-04-17 15:22:16 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-05-21 16:22:12 +0400
commit2a848b2c7fcc8f5cb370a73ec9ca40d32c6cf18c (patch)
tree63456fcb4d25458306c66d4f27820972b7537776 /drivers/media/v4l2-core/videobuf-dma-contig.c
parent4c8d558a1403cedd465395d719d13778b0f689f2 (diff)
downloadlinux-2a848b2c7fcc8f5cb370a73ec9ca40d32c6cf18c.tar.xz
[media] videobuf-dma-contig: use vm_iomap_memory()
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>
Diffstat (limited to 'drivers/media/v4l2-core/videobuf-dma-contig.c')
-rw-r--r--drivers/media/v4l2-core/videobuf-dma-contig.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/media/v4l2-core/videobuf-dma-contig.c b/drivers/media/v4l2-core/videobuf-dma-contig.c
index 8204c8810372..65411adcd0ea 100644
--- a/drivers/media/v4l2-core/videobuf-dma-contig.c
+++ b/drivers/media/v4l2-core/videobuf-dma-contig.c
@@ -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);