diff options
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-video.c | 7 | ||||
-rw-r--r-- | linux/drivers/media/video/sn9c102/sn9c102_core.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/usbvision/usbvision-video.c | 10 | ||||
-rw-r--r-- | v4l/compat.h | 10 | ||||
-rw-r--r-- | v4l/versions.txt | 6 |
5 files changed, 13 insertions, 26 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c index f03547db8..3abd11d2b 100644 --- a/linux/drivers/media/video/em28xx/em28xx-video.c +++ b/linux/drivers/media/video/em28xx/em28xx-video.c @@ -660,15 +660,8 @@ static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) pos = dev->frame[i].bufmem; while (size > 0) { /* size is page-aligned */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) - unsigned long page = vmalloc_to_pfn(pos); - if (remap_pfn_range(vma, start, page, PAGE_SIZE, - vma->vm_page_prot)) { - em28xx_videodbg("mmap: rename page map failed\n"); -#else if (vm_insert_page(vma, start, vmalloc_to_page(pos))) { em28xx_videodbg("mmap: vm_insert_page failed\n"); -#endif mutex_unlock(&dev->fileop_lock); return -EAGAIN; } diff --git a/linux/drivers/media/video/sn9c102/sn9c102_core.c b/linux/drivers/media/video/sn9c102/sn9c102_core.c index ef431d942..956e25041 100644 --- a/linux/drivers/media/video/sn9c102/sn9c102_core.c +++ b/linux/drivers/media/video/sn9c102/sn9c102_core.c @@ -2025,13 +2025,7 @@ static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma) pos = cam->frame[i].bufmem; while (size > 0) { /* size is page-aligned */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) - unsigned long page = vmalloc_to_pfn(pos); - if (remap_pfn_range(vma, start, page, PAGE_SIZE, - vma->vm_page_prot)) { -#else if (vm_insert_page(vma, start, vmalloc_to_page(pos))) { -#endif mutex_unlock(&cam->fileop_mutex); return -EAGAIN; } diff --git a/linux/drivers/media/video/usbvision/usbvision-video.c b/linux/drivers/media/video/usbvision/usbvision-video.c index 1d0d61469..ff9d1cbbb 100644 --- a/linux/drivers/media/video/usbvision/usbvision-video.c +++ b/linux/drivers/media/video/usbvision/usbvision-video.c @@ -1255,21 +1255,11 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma) pos = usbvision->frame[i].data; while (size > 0) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) - unsigned long page = vmalloc_to_pfn(pos); - if (remap_pfn_range(vma, start, page, PAGE_SIZE, - vma->vm_page_prot)) { - PDEBUG(DBG_MMAP, "mmap: rename page map failed"); - up(&usbvision->lock); - return -EAGAIN; - } -#else if (vm_insert_page(vma, start, vmalloc_to_page(pos))) { PDEBUG(DBG_MMAP, "mmap: vm_insert_page failed"); up(&usbvision->lock); return -EAGAIN; } -#endif start += PAGE_SIZE; pos += PAGE_SIZE; size -= PAGE_SIZE; diff --git a/v4l/compat.h b/v4l/compat.h index 25c11f460..2b2de93a7 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -224,6 +224,16 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) #endif +/* vm_insert_page() was added in 2.6.15 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) && defined(_LINUX_MM_H) +static inline int vm_insert_page(struct vm_area_struct *vma, + unsigned long addr, struct page *page) +{ + return remap_pfn_range(vma, addr, page_to_pfn(page), PAGE_SIZE, + vma->vm_page_prot); +} +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) #ifndef kcalloc #define kcalloc(n,size,flags) \ diff --git a/v4l/versions.txt b/v4l/versions.txt index d00fc9a67..f29387417 100644 --- a/v4l/versions.txt +++ b/v4l/versions.txt @@ -39,9 +39,6 @@ TUNER_3036 # Uses vm_insert_page() [2.6.15] -USB_ZC0301 -USB_ET61X251 -USB_ZR364XX [2.6.12] VIDEO_VIVI @@ -216,3 +213,6 @@ VIDEO_SAA7110 SOUND_ACI_MIXER USB_KONICAWC USB_QUICKCAM_MESSENGER +USB_ZC0301 +USB_ET61X251 +USB_ZR364XX |