summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/cx88/cx88.h1
-rw-r--r--linux/drivers/media/video/em28xx/em28xx.h4
-rw-r--r--linux/drivers/media/video/meye.c4
-rw-r--r--linux/drivers/media/video/stk-webcam.c8
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-video.c3
-rw-r--r--linux/drivers/media/video/v4l2-dev.c7
-rw-r--r--linux/drivers/media/video/v4l2-ioctl.c5
-rw-r--r--linux/drivers/media/video/zoran/zoran_driver.c7
8 files changed, 10 insertions, 29 deletions
diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h
index d641c24c3..2227d93c7 100644
--- a/linux/drivers/media/video/cx88/cx88.h
+++ b/linux/drivers/media/video/cx88/cx88.h
@@ -306,7 +306,6 @@ struct cx88_dmaqueue {
struct btcx_riscmem stopper;
u32 count;
};
-struct cx88_core;
struct cx88_core {
struct list_head devlist;
diff --git a/linux/drivers/media/video/em28xx/em28xx.h b/linux/drivers/media/video/em28xx/em28xx.h
index 235b63499..43c537e66 100644
--- a/linux/drivers/media/video/em28xx/em28xx.h
+++ b/linux/drivers/media/video/em28xx/em28xx.h
@@ -571,11 +571,7 @@ struct em28xx {
/* Snapshot button */
char snapshot_button_path[30]; /* path of the input dev */
struct input_dev *sbutton_input_dev;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
- struct work_struct sbutton_query_work;
-#else
struct delayed_work sbutton_query_work;
-#endif
struct em28xx_dvb *dvb;
};
diff --git a/linux/drivers/media/video/meye.c b/linux/drivers/media/video/meye.c
index 323aa378b..0fd646f7c 100644
--- a/linux/drivers/media/video/meye.c
+++ b/linux/drivers/media/video/meye.c
@@ -1451,10 +1451,6 @@ static int vidioc_querybuf(struct file *file, void *fh, struct v4l2_buffer *buf)
if (index < 0 || index >= gbuffers)
return -EINVAL;
- memset(buf, 0, sizeof(*buf));
-
- buf->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- buf->index = index;
buf->bytesused = meye.grab_buffer[index].size;
buf->flags = V4L2_BUF_FLAG_MAPPED;
diff --git a/linux/drivers/media/video/stk-webcam.c b/linux/drivers/media/video/stk-webcam.c
index 3af084640..52bf877bf 100644
--- a/linux/drivers/media/video/stk-webcam.c
+++ b/linux/drivers/media/video/stk-webcam.c
@@ -1140,16 +1140,10 @@ static int stk_vidioc_reqbufs(struct file *filp,
static int stk_vidioc_querybuf(struct file *filp,
void *priv, struct v4l2_buffer *buf)
{
- int index;
struct stk_camera *dev = priv;
struct stk_sio_buffer *sbuf;
- if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
- return -EINVAL;
-
- index = buf->index;
-
- if (index < 0 || index >= dev->n_sbufs)
+ if (buf->index < 0 || buf->index >= dev->n_sbufs)
return -EINVAL;
sbuf = dev->sio_bufs + buf->index;
*buf = sbuf->v4lbuf;
diff --git a/linux/drivers/media/video/usbvision/usbvision-video.c b/linux/drivers/media/video/usbvision/usbvision-video.c
index 33d79a5da..863fcb316 100644
--- a/linux/drivers/media/video/usbvision/usbvision-video.c
+++ b/linux/drivers/media/video/usbvision/usbvision-video.c
@@ -788,9 +788,6 @@ static int vidioc_querybuf (struct file *file,
/* FIXME : must control
that buffers are mapped (VIDIOC_REQBUFS has been called) */
- if(vb->type != V4L2_CAP_VIDEO_CAPTURE) {
- return -EINVAL;
- }
if(vb->index>=usbvision->num_frames) {
return -EINVAL;
}
diff --git a/linux/drivers/media/video/v4l2-dev.c b/linux/drivers/media/video/v4l2-dev.c
index e6dc1279a..861e3194f 100644
--- a/linux/drivers/media/video/v4l2-dev.c
+++ b/linux/drivers/media/video/v4l2-dev.c
@@ -404,12 +404,11 @@ int video_register_device_index(struct video_device *vdev, int type, int nr,
/* A minor value of -1 marks this video device as never
having been registered */
- if (vdev)
- vdev->minor = -1;
+ vdev->minor = -1;
/* the release callback MUST be present */
- WARN_ON(!vdev || !vdev->release);
- if (!vdev || !vdev->release)
+ WARN_ON(!vdev->release);
+ if (!vdev->release)
return -EINVAL;
/* Part 1: check device type */
diff --git a/linux/drivers/media/video/v4l2-ioctl.c b/linux/drivers/media/video/v4l2-ioctl.c
index ec139df5c..f2d74fedf 100644
--- a/linux/drivers/media/video/v4l2-ioctl.c
+++ b/linux/drivers/media/video/v4l2-ioctl.c
@@ -970,6 +970,11 @@ static long __video_do_ioctl(struct file *file,
if (ret)
break;
+ /* Zero out all fields starting with bytesysed, which is
+ * everything but index and type. */
+ memset(0, &p->bytesused,
+ sizeof(*p) - offsetof(typeof(*p), bytesused));
+
ret = ops->vidioc_querybuf(file, fh, p);
if (!ret)
dbgbuf(cmd, vfd, p);
diff --git a/linux/drivers/media/video/zoran/zoran_driver.c b/linux/drivers/media/video/zoran/zoran_driver.c
index 7ddbdf37d..8eda83b06 100644
--- a/linux/drivers/media/video/zoran/zoran_driver.c
+++ b/linux/drivers/media/video/zoran/zoran_driver.c
@@ -2499,12 +2499,7 @@ static int zoran_querybuf(struct file *file, void *__fh, struct v4l2_buffer *buf
{
struct zoran_fh *fh = __fh;
struct zoran *zr = fh->zr;
- __u32 type = buf->type;
- int index = buf->index, res;
-
- memset(buf, 0, sizeof(*buf));
- buf->type = type;
- buf->index = index;
+ int res;
mutex_lock(&zr->resource_lock);
res = zoran_v4l2_buffer_status(file, buf, buf->index);