summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zttranscode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/zttranscode.c b/zttranscode.c
index 08fac66..207b561 100644
--- a/zttranscode.c
+++ b/zttranscode.c
@@ -351,6 +351,7 @@ static int zt_tc_mmap(struct file *file, struct vm_area_struct *vma)
{
struct zt_transcoder_channel *ztc = file->private_data;
unsigned long physical;
+ int res;
if (!ztc)
return -EINVAL;
@@ -369,7 +370,12 @@ static int zt_tc_mmap(struct file *file, struct vm_area_struct *vma)
}
physical = (unsigned long) virt_to_phys(ztc->tch);
- if (remap_pfn_range(vma, vma->vm_start, physical >> PAGE_SHIFT, sizeof(struct zt_transcode_header), PAGE_SHARED)) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+ res = remap_pfn_range(vma, vma->vm_start, physical, sizeof(struct zt_transcode_header), PAGE_SHARED);
+#else
+ res = remap_page_range(vma, vma->vm_start, physical >> PAGE_SHIFT, sizeof(struct zt_transcode_header), PAGE_SHARED);
+#endif
+ if (res) {
if (debug)
printk("zttranscode: remap failed!\n");
return -EAGAIN;