Commit 2509e1cb authored by Trent Piepho's avatar Trent Piepho Committed by Mauro Carvalho Chehab

V4L/DVB (11265): stkwebcam: Remove buffer type check from g_parm and q/dq/reqbufs

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().

Cc: Jaime Velasco Juan <jsagarribay@gmail.com>
Signed-off-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 020b882b
...@@ -1112,8 +1112,6 @@ static int stk_vidioc_reqbufs(struct file *filp, ...@@ -1112,8 +1112,6 @@ static int stk_vidioc_reqbufs(struct file *filp,
if (dev == NULL) if (dev == NULL)
return -ENODEV; return -ENODEV;
if (rb->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
if (rb->memory != V4L2_MEMORY_MMAP) if (rb->memory != V4L2_MEMORY_MMAP)
return -EINVAL; return -EINVAL;
if (is_streaming(dev) if (is_streaming(dev)
...@@ -1152,8 +1150,6 @@ static int stk_vidioc_qbuf(struct file *filp, ...@@ -1152,8 +1150,6 @@ static int stk_vidioc_qbuf(struct file *filp,
struct stk_camera *dev = priv; struct stk_camera *dev = priv;
struct stk_sio_buffer *sbuf; struct stk_sio_buffer *sbuf;
unsigned long flags; unsigned long flags;
if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
if (buf->memory != V4L2_MEMORY_MMAP) if (buf->memory != V4L2_MEMORY_MMAP)
return -EINVAL; return -EINVAL;
...@@ -1180,8 +1176,7 @@ static int stk_vidioc_dqbuf(struct file *filp, ...@@ -1180,8 +1176,7 @@ static int stk_vidioc_dqbuf(struct file *filp,
unsigned long flags; unsigned long flags;
int ret; int ret;
if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE if (!is_streaming(dev))
|| !is_streaming(dev))
return -EINVAL; return -EINVAL;
if (filp->f_flags & O_NONBLOCK && list_empty(&dev->sio_full)) if (filp->f_flags & O_NONBLOCK && list_empty(&dev->sio_full))
...@@ -1240,9 +1235,6 @@ static int stk_vidioc_streamoff(struct file *filp, ...@@ -1240,9 +1235,6 @@ static int stk_vidioc_streamoff(struct file *filp,
static int stk_vidioc_g_parm(struct file *filp, static int stk_vidioc_g_parm(struct file *filp,
void *priv, struct v4l2_streamparm *sp) void *priv, struct v4l2_streamparm *sp)
{ {
if (sp->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
/*FIXME This is not correct */ /*FIXME This is not correct */
sp->parm.capture.timeperframe.numerator = 1; sp->parm.capture.timeperframe.numerator = 1;
sp->parm.capture.timeperframe.denominator = 30; sp->parm.capture.timeperframe.denominator = 30;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment