Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[cascardo/linux.git] / drivers / media / video / em28xx / em28xx-video.c
index 57c1826..3a56120 100644 (file)
@@ -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
@@ -226,7 +216,7 @@ static int em28xx_config(struct em28xx *dev)
  * em28xx_config_i2c()
  * configure i2c attached devices
  */
-void em28xx_config_i2c(struct em28xx *dev)
+static void em28xx_config_i2c(struct em28xx *dev)
 {
        struct v4l2_frequency f;
        struct video_decoder_init em28xx_vdi = {.data = NULL };
@@ -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;
                }
@@ -1895,7 +1884,6 @@ static void em28xx_usb_disconnect(struct usb_interface *interface)
 }
 
 static struct usb_driver em28xx_usb_driver = {
-       .owner = THIS_MODULE,
        .name = "em28xx",
        .probe = em28xx_usb_probe,
        .disconnect = em28xx_usb_disconnect,