]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/c-qcam.c
V4L/DVB (8513): gspca: Set the specific per webcam information in driver_info.
[linux-2.6-omap-h63xx.git] / drivers / media / video / c-qcam.c
index cf1546b5a7f1b33e8f8f7d8e865fa54f4fe518e5..62ed8949d46152dcf2b7cf7d973bb2f9b440d955 100644 (file)
@@ -35,7 +35,9 @@
 #include <linux/sched.h>
 #include <linux/videodev.h>
 #include <media/v4l2-common.h>
+#include <media/v4l2-ioctl.h>
 #include <linux/mutex.h>
+#include <linux/jiffies.h>
 
 #include <asm/uaccess.h>
 
@@ -69,7 +71,7 @@ struct qcam_device {
 
 static int parport[MAX_CAMS] = { [1 ... MAX_CAMS-1] = -1 };
 static int probe = 2;
-static int force_rgb = 0;
+static int force_rgb;
 static int video_nr = -1;
 
 static inline void qcam_set_ack(struct qcam_device *qcam, unsigned int i)
@@ -95,7 +97,8 @@ static unsigned int qcam_await_ready1(struct qcam_device *qcam,
        unsigned long oldjiffies = jiffies;
        unsigned int i;
 
-       for (oldjiffies = jiffies; (jiffies - oldjiffies) < msecs_to_jiffies(40); )
+       for (oldjiffies = jiffies;
+            time_before(jiffies, oldjiffies + msecs_to_jiffies(40)); )
                if (qcam_ready1(qcam) == value)
                        return 0;
 
@@ -120,7 +123,8 @@ static unsigned int qcam_await_ready2(struct qcam_device *qcam, int value)
        unsigned long oldjiffies = jiffies;
        unsigned int i;
 
-       for (oldjiffies = jiffies; (jiffies - oldjiffies) < msecs_to_jiffies(40); )
+       for (oldjiffies = jiffies;
+            time_before(jiffies, oldjiffies + msecs_to_jiffies(40)); )
                if (qcam_ready2(qcam) == value)
                        return 0;
 
@@ -689,14 +693,15 @@ static const struct file_operations qcam_fops = {
        .open           = video_exclusive_open,
        .release        = video_exclusive_release,
        .ioctl          = qcam_ioctl,
+#ifdef CONFIG_COMPAT
        .compat_ioctl   = v4l_compat_ioctl32,
+#endif
        .read           = qcam_read,
        .llseek         = no_llseek,
 };
 
 static struct video_device qcam_template=
 {
-       .owner          = THIS_MODULE,
        .name           = "Colour QuickCam",
        .type           = VID_TYPE_CAPTURE,
        .fops           = &qcam_fops,
@@ -741,7 +746,7 @@ static struct qcam_device *qcam_init(struct parport *port)
 }
 
 static struct qcam_device *qcams[MAX_CAMS];
-static unsigned int num_cams = 0;
+static unsigned int num_cams;
 
 static int init_cqcam(struct parport *port)
 {