summaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-05-14 04:51:10 +0200
committerSuren A. Chilingaryan <csa@suren.me>2016-05-14 04:51:10 +0200
commite9d114839b813240b460be4ef7d1bfb7560a2482 (patch)
tree362efbf59b87042b3c7a5ff0c4afb420ebd5fdd9 /driver
parenta21dea7a0d06cbdfe9a94c88b1ba99425bf2e102 (diff)
downloadpcitool-e9d114839b813240b460be4ef7d1bfb7560a2482.tar.gz
pcitool-e9d114839b813240b460be4ef7d1bfb7560a2482.tar.bz2
pcitool-e9d114839b813240b460be4ef7d1bfb7560a2482.tar.xz
pcitool-e9d114839b813240b460be4ef7d1bfb7560a2482.zip
Fix handling of vm_pgoff in the driver
Diffstat (limited to 'driver')
-rw-r--r--driver/dev.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/driver/dev.c b/driver/dev.c
index 75b2516..fce6896 100644
--- a/driver/dev.c
+++ b/driver/dev.c
@@ -133,19 +133,13 @@ static int pcidriver_mmap_area(pcidriver_privdata_t *privdata, struct vm_area_st
int ret = 0;
unsigned long vma_size;
- unsigned long addr = vmap->vm_pgoff;
mod_info_dbg("Entering mmap_addr\n");
/* Check sizes */
vma_size = (vmap->vm_end - vmap->vm_start);
- if (addr % PAGE_SIZE) {
- mod_info("mmap addr (0x%lx) is not aligned to page boundary\n", addr);
- return -EINVAL;
- }
-
- ret = remap_pfn_range(vmap, vmap->vm_start, (addr >> PAGE_SHIFT), vma_size, vmap->vm_page_prot);
+ ret = remap_pfn_range(vmap, vmap->vm_start, vmap->vm_pgoff, vma_size, vmap->vm_page_prot);
if (ret) {
mod_info("remap_pfn_range failed\n");