summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-03-28 18:25:36 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2009-03-28 18:25:36 -0700
commit08340d0b0c4b007c6ea1f300e3281b012da7f21b (patch)
treedf77f4eda2117643b00f22ae0e10d4bc9bce4642
parent3a35050c66a731aa86d6cb3a7578e19036879be1 (diff)
downloadmediapointer-dvb-s2-08340d0b0c4b007c6ea1f300e3281b012da7f21b.tar.gz
mediapointer-dvb-s2-08340d0b0c4b007c6ea1f300e3281b012da7f21b.tar.bz2
stkwebcam: Remove buffer type check from g_parm and q/dq/reqbufs
From: Trent Piepho <xyzzy@speakeasy.org> The v4l2-ioctl core only allows buffer types for which the corresponding ->vidioc_try_fmt_xxx() methods are defined to be used with vidioc_(q|dq|query)bufs(), vidioc_reqbufs() and now vidioc_(s|g)_parm. This driver only defines ->vidioc_try_fmt_vid_cap() so only VIDEO_CAPTURE buffers are allowed to be used with vidioc_g_parm(), vidioc_qbuf(), vidioc_dqbuf(), and vidioc_reqbufs(). Priority: normal Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> CC: Jaime Velasco Juan <jsagarribay@gmail.com>
-rw-r--r--linux/drivers/media/video/stk-webcam.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/linux/drivers/media/video/stk-webcam.c b/linux/drivers/media/video/stk-webcam.c
index 54efa2cc0..7cbc4f736 100644
--- a/linux/drivers/media/video/stk-webcam.c
+++ b/linux/drivers/media/video/stk-webcam.c
@@ -1113,8 +1113,6 @@ static int stk_vidioc_reqbufs(struct file *filp,
if (dev == NULL)
return -ENODEV;
- if (rb->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
- return -EINVAL;
if (rb->memory != V4L2_MEMORY_MMAP)
return -EINVAL;
if (is_streaming(dev)
@@ -1153,8 +1151,6 @@ static int stk_vidioc_qbuf(struct file *filp,
struct stk_camera *dev = priv;
struct stk_sio_buffer *sbuf;
unsigned long flags;
- if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
- return -EINVAL;
if (buf->memory != V4L2_MEMORY_MMAP)
return -EINVAL;
@@ -1181,8 +1177,7 @@ static int stk_vidioc_dqbuf(struct file *filp,
unsigned long flags;
int ret;
- if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE
- || !is_streaming(dev))
+ if (!is_streaming(dev))
return -EINVAL;
if (filp->f_flags & O_NONBLOCK && list_empty(&dev->sio_full))
@@ -1241,9 +1236,6 @@ static int stk_vidioc_streamoff(struct file *filp,
static int stk_vidioc_g_parm(struct file *filp,
void *priv, struct v4l2_streamparm *sp)
{
- if (sp->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
- return -EINVAL;
-
/*FIXME This is not correct */
sp->parm.capture.timeperframe.numerator = 1;
sp->parm.capture.timeperframe.denominator = 30;