vserver 1.9.5.x5
[linux-2.6.git] / drivers / media / video / planb.c
index b790765..10eb49b 100644 (file)
@@ -178,8 +178,7 @@ static unsigned char saa_status(int byte, struct planb *pb)
        saa_write_reg (SAA7196_STDC, saa_regs[pb->win.norm][SAA7196_STDC]);
 
        /* Let's wait 30msec for this one */
-       current->state = TASK_INTERRUPTIBLE;
-       schedule_timeout(30 * HZ / 1000);
+       msleep_interruptible(30);
 
        return (unsigned char)in_8 (&planb_regs->saa_status);
 }
@@ -1383,8 +1382,6 @@ static int planb_open(struct video_device *dev, int mode)
        pb->user++;
 
        DEBUG("PlanB: device opened\n");
-
-       MOD_INC_USE_COUNT;
        return 0;   
 }
 
@@ -1407,8 +1404,6 @@ static void planb_close(struct video_device *dev)
        planb_unlock(pb);
 
        DEBUG("PlanB: device closed\n");
-
-       MOD_DEC_USE_COUNT;  
 }
 
 static long planb_read(struct video_device *v, char *buf, unsigned long count,
@@ -2000,8 +1995,10 @@ static int planb_mmap(struct vm_area_struct *vma, struct video_device *dev, cons
                        return err;
        }
        for (i = 0; i < pb->rawbuf_size; i++) {
-               if (remap_page_range(vma, start, virt_to_phys((void *)pb->rawbuf[i]),
-                                               PAGE_SIZE, PAGE_SHARED))
+               unsigned long pfn;
+
+               pfn = virt_to_phys((void *)pb->rawbuf[i]) >> PAGE_SHIFT;
+               if (remap_pfn_range(vma, start, pfn, PAGE_SIZE, PAGE_SHARED))
                        return -EAGAIN;
                start += PAGE_SIZE;
                if (size <= PAGE_SIZE)