The patch number 11265 was added via Trent Piepho <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <[email protected]>

------

From: Trent Piepho  <[email protected]>
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().

Priority: normal

Signed-off-by: Trent Piepho <[email protected]>
CC: Jaime Velasco Juan <[email protected]>


---

 linux/drivers/media/video/stk-webcam.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff -r c545d5d1afcc -r fb30bf07ca40 linux/drivers/media/video/stk-webcam.c
--- a/linux/drivers/media/video/stk-webcam.c    Sat Mar 28 18:25:36 2009 -0700
+++ b/linux/drivers/media/video/stk-webcam.c    Sat Mar 28 18:25:36 2009 -0700
@@ -1113,8 +1113,6 @@ static int stk_vidioc_reqbufs(struct fil
 
        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 *
        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 
        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_g_parm(struct file
 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;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/fb30bf07ca405500b50b1935f615b5c7a655642b

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to