diff options
author | Sascha Sommer <saschasommer@freenet.de> | 2005-12-12 09:37:30 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-12 17:57:44 +0100 |
commit | 3639c8619d50a6dea8fa106a5c61d848ffdcd3d6 (patch) | |
tree | f2ec8303fee79b26097ba996941a6550ffac7dbc /drivers/media/video/em28xx/em28xx-video.c | |
parent | [PATCH] V4L/DVB: (3135) Fix tuner init for Pinnacle PCTV Stereo (diff) | |
download | linux-3639c8619d50a6dea8fa106a5c61d848ffdcd3d6.tar.xz linux-3639c8619d50a6dea8fa106a5c61d848ffdcd3d6.zip |
[PATCH] V4L/DVB: (3113) Convert em28xx to use vm_insert_page instead of remap_pfn_range
Convert em28xx to use vm_insert_page instead of remap_pfn_range
Signed-off-by: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: Michael Krufky <mkrufky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index c08e505e7009..8ecaa0803e08 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c @@ -189,16 +189,6 @@ static DECLARE_RWSEM(em28xx_disconnect); /********************* v4l2 interface ******************************************/ -static inline unsigned long kvirt_to_pa(unsigned long adr) -{ - unsigned long kva, ret; - - kva = (unsigned long)page_address(vmalloc_to_page((void *)adr)); - kva |= adr & (PAGE_SIZE - 1); - ret = __pa(kva); - return ret; -} - /* * em28xx_config() * inits registers with sane defaults @@ -616,7 +606,8 @@ static struct vm_operations_struct em28xx_vm_ops = { static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) { unsigned long size = vma->vm_end - vma->vm_start, - start = vma->vm_start, pos, page; + start = vma->vm_start; + void *pos; u32 i; struct em28xx *dev = filp->private_data; @@ -657,12 +648,10 @@ static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) vma->vm_flags |= VM_IO; vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ - pos = (unsigned long)dev->frame[i].bufmem; + pos = dev->frame[i].bufmem; while (size > 0) { /* size is page-aligned */ - page = vmalloc_to_pfn((void *)pos); - if (remap_pfn_range(vma, start, page, PAGE_SIZE, - vma->vm_page_prot)) { - em28xx_videodbg("mmap: rename page map failed\n"); + if (vm_insert_page(vma, start, vmalloc_to_page(pos))) { + em28xx_videodbg("mmap: vm_insert_page failed\n"); up(&dev->fileop_lock); return -EAGAIN; } |