summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-12-05 14:54:22 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-12-05 14:54:22 +0000
commit48cb2dbb0a6508a5c26230aaa9ba19f2bd61869e (patch)
treeff50c10f3bb9bf5f8f5f6d845357b9d90e904108 /linux/drivers/media/video/em28xx/em28xx-video.c
parent1d440680a0d576fd9d332e29e6de9c40d064b502 (diff)
downloadmediapointer-dvb-s2-48cb2dbb0a6508a5c26230aaa9ba19f2bd61869e.tar.gz
mediapointer-dvb-s2-48cb2dbb0a6508a5c26230aaa9ba19f2bd61869e.tar.bz2
Make em28xx page alloc compatible with kernels < 2.6.15
From: Sascha Sommer <saschasommer@freenet.de> kernel-sync - Make em28xx page alloc compatible with kernels < 2.6.15 Signed-off-by: Sascha Sommer <saschasommer@freenet.de> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index 1cdf022d9..bdfa47898 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -745,8 +745,15 @@ 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
up(&dev->fileop_lock);
return -EAGAIN;
}