/alps/pcitool

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to driver/dev.c

  • Committer: Suren A. Chilingaryan
  • Date: 2016-05-14 02:51:10 UTC
  • Revision ID: csa@suren.me-20160514025110-9c46hqdxdb2dpmf3
Fix handling of vm_pgoff in the driver

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
    int ret = 0;
134
134
 
135
135
    unsigned long vma_size;
136
 
    unsigned long addr = vmap->vm_pgoff;
137
136
 
138
137
    mod_info_dbg("Entering mmap_addr\n");
139
138
 
140
139
    /* Check sizes */
141
140
    vma_size = (vmap->vm_end - vmap->vm_start);
142
141
 
143
 
    if (addr % PAGE_SIZE) {
144
 
        mod_info("mmap addr (0x%lx) is not aligned to page boundary\n", addr);
145
 
        return -EINVAL;
146
 
    }
147
 
 
148
 
    ret = remap_pfn_range(vmap, vmap->vm_start, (addr >> PAGE_SHIFT), vma_size, vmap->vm_page_prot);
 
142
    ret = remap_pfn_range(vmap, vmap->vm_start, vmap->vm_pgoff, vma_size, vmap->vm_page_prot);
149
143
 
150
144
    if (ret) {
151
145
        mod_info("remap_pfn_range failed\n");