aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/c-qcam.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/c-qcam.c')
-rw-r--r--drivers/media/video/c-qcam.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c
index cf1546b5a7f..fe1e67bb1ca 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
70static int parport[MAX_CAMS] = { [1 ... MAX_CAMS-1] = -1 }; 71static int parport[MAX_CAMS] = { [1 ... MAX_CAMS-1] = -1 };
71static int probe = 2; 72static int probe = 2;
72static int force_rgb = 0; 73static int force_rgb;
73static int video_nr = -1; 74static int video_nr = -1;
74 75
75static inline void qcam_set_ack(struct qcam_device *qcam, unsigned int i) 76static 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
743static struct qcam_device *qcams[MAX_CAMS]; 748static struct qcam_device *qcams[MAX_CAMS];
744static unsigned int num_cams = 0; 749static unsigned int num_cams;
745 750
746static int init_cqcam(struct parport *port) 751static int init_cqcam(struct parport *port)
747{ 752{