Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a848b2c authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 4c8d558a
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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);