summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common/saa7146_video.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/common/saa7146_video.c')
-rw-r--r--linux/drivers/media/common/saa7146_video.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
index 6f6edcb90..c19d2e043 100644
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -1154,7 +1154,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
case VIDIOC_DQBUF: {
struct v4l2_buffer *buf = arg;
int ret = 0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
+ ret = videobuf_dqbuf(file,q,buf);
+#else
ret = videobuf_dqbuf(file,q,buf,file->f_flags & O_NONBLOCK);
+#endif
DEB_D(("VIDIOC_DQBUF: ret:%d, index:%d\n",ret,buf->index));
return ret;
}
@@ -1247,9 +1251,14 @@ static int buffer_activate (struct saa7146_dev *dev,
return 0;
}
-static int buffer_prepare(void *priv, struct videobuf_buffer *vb, enum v4l2_field field)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
+static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l2_field field)
+{
+#else
+static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field field)
{
struct file *file = priv;
+#endif
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
@@ -1330,9 +1339,14 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb, enum v4l2_fiel
return err;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
+static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
+{
+#else
static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
{
struct file *file = priv;
+#endif
struct saa7146_fh *fh = file->private_data;
if (0 == *count || *count > MAX_SAA7146_CAPTURE_BUFFERS)
@@ -1350,9 +1364,14 @@ static int buffer_setup(void *priv, unsigned int *count, unsigned int *size)
return 0;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
+static void buffer_queue(struct file *file, struct videobuf_buffer *vb)
+{
+#else
static void buffer_queue(void *priv, struct videobuf_buffer *vb)
{
struct file *file = priv;
+#endif
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
@@ -1362,10 +1381,14 @@ static void buffer_queue(void *priv, struct videobuf_buffer *vb)
saa7146_buffer_queue(fh->dev,&vv->video_q,buf);
}
-
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
+static void buffer_release(struct file *file, struct videobuf_buffer *vb)
+{
+#else
static void buffer_release(void *priv, struct videobuf_buffer *vb)
{
struct file *file = priv;
+#endif
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
struct saa7146_buf *buf = (struct saa7146_buf *)vb;
@@ -1485,8 +1508,12 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo
goto out;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10))
+ ret = videobuf_read_one(file,&fh->video_q , data, count, ppos);
+#else
ret = videobuf_read_one(file,&fh->video_q , data, count, ppos,
file->f_flags & O_NONBLOCK);
+#endif
if (ret != 0) {
video_end(fh, file);
} else {