From e9d114839b813240b460be4ef7d1bfb7560a2482 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sat, 14 May 2016 04:51:10 +0200 Subject: Fix handling of vm_pgoff in the driver --- driver/dev.c | 8 +------- 1 file changed, 1 insertion(+), 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"); -- cgit v1.2.3