diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-12-20 23:03:50 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-12-20 23:03:50 -0500 |
commit | 041387d98460b3947587929ef3a4773b8c48538f (patch) | |
tree | 3330eebba3fa1aa7c13479e527f07b03d7fb53ed /drivers/media/video/em28xx/em28xx-video.c | |
parent | 56f0356321a876a1a356712f2486d6188a3b4992 (diff) | |
parent | b05948d9b7167e23af88cc65b9ffa4687eaf1f0d (diff) |
Manual merge with Linus (conflict in drivers/input/misc/wistron_bnts.c)
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 abec32c175aa..06d76879bde2 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); | |||
189 | 189 | ||
190 | /********************* v4l2 interface ******************************************/ | 190 | /********************* v4l2 interface ******************************************/ |
191 | 191 | ||
192 | static inline unsigned long kvirt_to_pa(unsigned long adr) | ||
193 | { | ||
194 | unsigned long kva, ret; | ||
195 | |||
196 | kva = (unsigned long)page_address(vmalloc_to_page((void *)adr)); | ||
197 | kva |= adr & (PAGE_SIZE - 1); | ||
198 | ret = __pa(kva); | ||
199 | return ret; | ||
200 | } | ||
201 | |||
202 | /* | 192 | /* |
203 | * em28xx_config() | 193 | * em28xx_config() |
204 | * inits registers with sane defaults | 194 | * inits registers with sane defaults |
@@ -616,7 +606,8 @@ static struct vm_operations_struct em28xx_vm_ops = { | |||
616 | static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) | 606 | static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) |
617 | { | 607 | { |
618 | unsigned long size = vma->vm_end - vma->vm_start, | 608 | unsigned long size = vma->vm_end - vma->vm_start, |
619 | start = vma->vm_start, pos, page; | 609 | start = vma->vm_start; |
610 | void *pos; | ||
620 | u32 i; | 611 | u32 i; |
621 | 612 | ||
622 | struct em28xx *dev = filp->private_data; | 613 | struct em28xx *dev = filp->private_data; |
@@ -657,12 +648,10 @@ static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) | |||
657 | vma->vm_flags |= VM_IO; | 648 | vma->vm_flags |= VM_IO; |
658 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | 649 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ |
659 | 650 | ||
660 | pos = (unsigned long)dev->frame[i].bufmem; | 651 | pos = dev->frame[i].bufmem; |
661 | while (size > 0) { /* size is page-aligned */ | 652 | while (size > 0) { /* size is page-aligned */ |
662 | page = vmalloc_to_pfn((void *)pos); | 653 | if (vm_insert_page(vma, start, vmalloc_to_page(pos))) { |
663 | if (remap_pfn_range(vma, start, page, PAGE_SIZE, | 654 | em28xx_videodbg("mmap: vm_insert_page failed\n"); |
664 | vma->vm_page_prot)) { | ||
665 | em28xx_videodbg("mmap: rename page map failed\n"); | ||
666 | up(&dev->fileop_lock); | 655 | up(&dev->fileop_lock); |
667 | return -EAGAIN; | 656 | return -EAGAIN; |
668 | } | 657 | } |