|
@@ -738,7 +738,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
|
|
|
return -EINVAL;
|
|
|
|
|
|
vma->vm_ops = &uio_physical_vm_ops;
|
|
|
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
|
|
+ if (idev->info->mem[mi].memtype == UIO_MEM_PHYS)
|
|
|
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
|
|
|
|
|
/*
|
|
|
* We cannot use the vm_iomap_memory() helper here,
|
|
@@ -795,18 +796,19 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma)
|
|
|
}
|
|
|
|
|
|
switch (idev->info->mem[mi].memtype) {
|
|
|
- case UIO_MEM_PHYS:
|
|
|
- ret = uio_mmap_physical(vma);
|
|
|
- break;
|
|
|
- case UIO_MEM_LOGICAL:
|
|
|
- case UIO_MEM_VIRTUAL:
|
|
|
- ret = uio_mmap_logical(vma);
|
|
|
- break;
|
|
|
- default:
|
|
|
- ret = -EINVAL;
|
|
|
+ case UIO_MEM_IOVA:
|
|
|
+ case UIO_MEM_PHYS:
|
|
|
+ ret = uio_mmap_physical(vma);
|
|
|
+ break;
|
|
|
+ case UIO_MEM_LOGICAL:
|
|
|
+ case UIO_MEM_VIRTUAL:
|
|
|
+ ret = uio_mmap_logical(vma);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ ret = -EINVAL;
|
|
|
}
|
|
|
|
|
|
-out:
|
|
|
+ out:
|
|
|
mutex_unlock(&idev->info_lock);
|
|
|
return ret;
|
|
|
}
|