diff options
Diffstat (limited to 'linux/drivers/media/common/saa7146_video.c')
-rw-r--r-- | linux/drivers/media/common/saa7146_video.c | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index 2f632b747..8cce44602 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -1137,7 +1137,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int case VIDIOC_REQBUFS: { struct v4l2_requestbuffers *req = arg; DEB_D(("VIDIOC_REQBUFS, type:%d\n",req->type)); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) return videobuf_reqbufs(file,q,req); +#else + return videobuf_reqbufs(q,req); +#endif } case VIDIOC_QUERYBUF: { struct v4l2_buffer *buf = arg; @@ -1147,7 +1151,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int case VIDIOC_QBUF: { struct v4l2_buffer *buf = arg; int ret = 0; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) ret = videobuf_qbuf(file,q,buf); +#else + ret = videobuf_qbuf(q,buf); +#endif DEB_D(("VIDIOC_QBUF: ret:%d, index:%d\n",ret,buf->index)); return ret; } @@ -1157,7 +1165,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int #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); + ret = videobuf_dqbuf(q,buf,file->f_flags & O_NONBLOCK); #endif DEB_D(("VIDIOC_DQBUF: ret:%d, index:%d\n",ret,buf->index)); return ret; @@ -1170,7 +1178,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int if( 0 != err) { return err; } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) err = videobuf_streamon(file,q); +#else + err = videobuf_streamon(q); +#endif return err; } case VIDIOC_STREAMOFF: { @@ -1191,7 +1203,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int return -EBUSY; } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) err = videobuf_streamoff(file,q); +#else + err = videobuf_streamoff(q); +#endif if (0 != err) { DEB_D(("warning: videobuf_streamoff() failed.\n")); video_end(fh, file); @@ -1214,8 +1230,13 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int q = &fh->video_q; down(&q->lock); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) err = videobuf_mmap_setup(file,q,gbuffers,gbufsize, V4L2_MEMORY_MMAP); +#else + err = videobuf_mmap_setup(q,gbuffers,gbufsize, + V4L2_MEMORY_MMAP); +#endif if (err < 0) { up(&q->lock); return err; @@ -1255,9 +1276,9 @@ static int buffer_activate (struct saa7146_dev *dev, 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) +static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,enum v4l2_field field) { - struct file *file = priv; + struct file *file = q->priv_data; #endif struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; @@ -1343,9 +1364,9 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field 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) +static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size) { - struct file *file = priv; + struct file *file = q->priv_data; #endif struct saa7146_fh *fh = file->private_data; @@ -1368,9 +1389,9 @@ static int buffer_setup(void *priv, unsigned int *count, unsigned int *size) static void buffer_queue(struct file *file, struct videobuf_buffer *vb) { #else -static void buffer_queue(void *priv, struct videobuf_buffer *vb) +static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct file *file = priv; + struct file *file = q->priv_data; #endif struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; @@ -1385,9 +1406,9 @@ static void buffer_queue(void *priv, struct videobuf_buffer *vb) static void buffer_release(struct file *file, struct videobuf_buffer *vb) { #else -static void buffer_release(void *priv, struct videobuf_buffer *vb) +static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) { - struct file *file = priv; + struct file *file = q->priv_data; #endif struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; @@ -1442,7 +1463,11 @@ static int video_open(struct saa7146_dev *dev, struct file *file) dev->pci, &dev->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_INTERLACED, - sizeof(struct saa7146_buf)); + sizeof(struct saa7146_buf) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) + ,file +#endif + ); init_MUTEX(&fh->video_q.lock); @@ -1509,9 +1534,9 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo } #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) - ret = videobuf_read_one(file,&fh->video_q , data, count, ppos); + ret = videobuf_read_one(file, &fh->video_q , data, count, ppos); #else - ret = videobuf_read_one(file,&fh->video_q , data, count, ppos, + ret = videobuf_read_one(&fh->video_q , data, count, ppos, file->f_flags & O_NONBLOCK); #endif if (ret != 0) { |