replace remap_page_range with remap_pfn_range
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 15 Mar 2005 01:00:33 +0000 (01:00 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 15 Mar 2005 01:00:33 +0000 (01:00 +0000)
comedi/comedi_fops.c
include/linux/mm.h

index df3a778ecdc796bd75c4ea3cf44b68c8da4d7a9e..c99f05760f1943a8076115d87d4efc19bc2ca12e 100644 (file)
@@ -1309,7 +1309,7 @@ static int comedi_mmap_v22(struct file * file, struct vm_area_struct *vma)
 
        n_pages = size >> PAGE_SHIFT;
        for(i=0;i<n_pages;i++){
-               if(REMAP_PAGE_RANGE(vma, start, __pa(async->buf_page_list[i]),
+               if(remap_pfn_range(vma, start, __pa(async->buf_page_list[i]) >> PAGE_SHIFT,
                                PAGE_SIZE, PAGE_SHARED)){
                        return -EAGAIN;
                }
index aabaccfcdc453eee4e00741b946e548c3c377561..4c19bc6a1c271bad164821f974440ee2605619fd 100644 (file)
 #define REMAP_PAGE_RANGE(a,b,c,d,e) remap_page_range(a,b,c,d,e)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
+static inline int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
+       unsigned long pfn, unsigned long size, pgprot_t prot)
+{
+       return REMAP_PAGE_RANGE(vma, from, pfn << PAGE_SHIFT, size, prot);
+};
+
+#endif
+
 #endif /* _COMPAT_MM_H */