diff options
Diffstat (limited to 'drivers/media/video/c-qcam.c')
-rw-r--r-- | drivers/media/video/c-qcam.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c index cf1546b5a7f1..fe1e67bb1ca8 100644 --- a/drivers/media/video/c-qcam.c +++ b/drivers/media/video/c-qcam.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/videodev.h> | 36 | #include <linux/videodev.h> |
37 | #include <media/v4l2-common.h> | 37 | #include <media/v4l2-common.h> |
38 | #include <linux/mutex.h> | 38 | #include <linux/mutex.h> |
39 | #include <linux/jiffies.h> | ||
39 | 40 | ||
40 | #include <asm/uaccess.h> | 41 | #include <asm/uaccess.h> |
41 | 42 | ||
@@ -69,7 +70,7 @@ struct qcam_device { | |||
69 | 70 | ||
70 | static int parport[MAX_CAMS] = { [1 ... MAX_CAMS-1] = -1 }; | 71 | static int parport[MAX_CAMS] = { [1 ... MAX_CAMS-1] = -1 }; |
71 | static int probe = 2; | 72 | static int probe = 2; |
72 | static int force_rgb = 0; | 73 | static int force_rgb; |
73 | static int video_nr = -1; | 74 | static int video_nr = -1; |
74 | 75 | ||
75 | static inline void qcam_set_ack(struct qcam_device *qcam, unsigned int i) | 76 | static inline void qcam_set_ack(struct qcam_device *qcam, unsigned int i) |
@@ -95,7 +96,8 @@ static unsigned int qcam_await_ready1(struct qcam_device *qcam, | |||
95 | unsigned long oldjiffies = jiffies; | 96 | unsigned long oldjiffies = jiffies; |
96 | unsigned int i; | 97 | unsigned int i; |
97 | 98 | ||
98 | for (oldjiffies = jiffies; (jiffies - oldjiffies) < msecs_to_jiffies(40); ) | 99 | for (oldjiffies = jiffies; |
100 | time_before(jiffies, oldjiffies + msecs_to_jiffies(40)); ) | ||
99 | if (qcam_ready1(qcam) == value) | 101 | if (qcam_ready1(qcam) == value) |
100 | return 0; | 102 | return 0; |
101 | 103 | ||
@@ -120,7 +122,8 @@ static unsigned int qcam_await_ready2(struct qcam_device *qcam, int value) | |||
120 | unsigned long oldjiffies = jiffies; | 122 | unsigned long oldjiffies = jiffies; |
121 | unsigned int i; | 123 | unsigned int i; |
122 | 124 | ||
123 | for (oldjiffies = jiffies; (jiffies - oldjiffies) < msecs_to_jiffies(40); ) | 125 | for (oldjiffies = jiffies; |
126 | time_before(jiffies, oldjiffies + msecs_to_jiffies(40)); ) | ||
124 | if (qcam_ready2(qcam) == value) | 127 | if (qcam_ready2(qcam) == value) |
125 | return 0; | 128 | return 0; |
126 | 129 | ||
@@ -689,7 +692,9 @@ static const struct file_operations qcam_fops = { | |||
689 | .open = video_exclusive_open, | 692 | .open = video_exclusive_open, |
690 | .release = video_exclusive_release, | 693 | .release = video_exclusive_release, |
691 | .ioctl = qcam_ioctl, | 694 | .ioctl = qcam_ioctl, |
695 | #ifdef CONFIG_COMPAT | ||
692 | .compat_ioctl = v4l_compat_ioctl32, | 696 | .compat_ioctl = v4l_compat_ioctl32, |
697 | #endif | ||
693 | .read = qcam_read, | 698 | .read = qcam_read, |
694 | .llseek = no_llseek, | 699 | .llseek = no_llseek, |
695 | }; | 700 | }; |
@@ -741,7 +746,7 @@ static struct qcam_device *qcam_init(struct parport *port) | |||
741 | } | 746 | } |
742 | 747 | ||
743 | static struct qcam_device *qcams[MAX_CAMS]; | 748 | static struct qcam_device *qcams[MAX_CAMS]; |
744 | static unsigned int num_cams = 0; | 749 | static unsigned int num_cams; |
745 | 750 | ||
746 | static int init_cqcam(struct parport *port) | 751 | static int init_cqcam(struct parport *port) |
747 | { | 752 | { |