diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-28 21:25:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:45 -0400 |
commit | 2509e1cb3360961113117f25ae482c430f3bd03d (patch) | |
tree | 44b4a0d4fea286262a09ca75136eed9f72035d35 /drivers/media/video/stk-webcam.c | |
parent | 020b882b1d34e8787658a15e00f2ea0d4651605b (diff) |
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: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/stk-webcam.c')
-rw-r--r-- | drivers/media/video/stk-webcam.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c index 6b7f0da9b515..1a6d39cbd6f3 100644 --- a/drivers/media/video/stk-webcam.c +++ b/drivers/media/video/stk-webcam.c | |||
@@ -1112,8 +1112,6 @@ static int stk_vidioc_reqbufs(struct file *filp, | |||
1112 | 1112 | ||
1113 | if (dev == NULL) | 1113 | if (dev == NULL) |
1114 | return -ENODEV; | 1114 | return -ENODEV; |
1115 | if (rb->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
1116 | return -EINVAL; | ||
1117 | if (rb->memory != V4L2_MEMORY_MMAP) | 1115 | if (rb->memory != V4L2_MEMORY_MMAP) |
1118 | return -EINVAL; | 1116 | return -EINVAL; |
1119 | if (is_streaming(dev) | 1117 | if (is_streaming(dev) |
@@ -1152,8 +1150,6 @@ static int stk_vidioc_qbuf(struct file *filp, | |||
1152 | struct stk_camera *dev = priv; | 1150 | struct stk_camera *dev = priv; |
1153 | struct stk_sio_buffer *sbuf; | 1151 | struct stk_sio_buffer *sbuf; |
1154 | unsigned long flags; | 1152 | unsigned long flags; |
1155 | if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
1156 | return -EINVAL; | ||
1157 | 1153 | ||
1158 | if (buf->memory != V4L2_MEMORY_MMAP) | 1154 | if (buf->memory != V4L2_MEMORY_MMAP) |
1159 | return -EINVAL; | 1155 | return -EINVAL; |
@@ -1180,8 +1176,7 @@ static int stk_vidioc_dqbuf(struct file *filp, | |||
1180 | unsigned long flags; | 1176 | unsigned long flags; |
1181 | int ret; | 1177 | int ret; |
1182 | 1178 | ||
1183 | if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE | 1179 | if (!is_streaming(dev)) |
1184 | || !is_streaming(dev)) | ||
1185 | return -EINVAL; | 1180 | return -EINVAL; |
1186 | 1181 | ||
1187 | if (filp->f_flags & O_NONBLOCK && list_empty(&dev->sio_full)) | 1182 | if (filp->f_flags & O_NONBLOCK && list_empty(&dev->sio_full)) |
@@ -1240,9 +1235,6 @@ static int stk_vidioc_streamoff(struct file *filp, | |||
1240 | static int stk_vidioc_g_parm(struct file *filp, | 1235 | static int stk_vidioc_g_parm(struct file *filp, |
1241 | void *priv, struct v4l2_streamparm *sp) | 1236 | void *priv, struct v4l2_streamparm *sp) |
1242 | { | 1237 | { |
1243 | if (sp->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
1244 | return -EINVAL; | ||
1245 | |||
1246 | /*FIXME This is not correct */ | 1238 | /*FIXME This is not correct */ |
1247 | sp->parm.capture.timeperframe.numerator = 1; | 1239 | sp->parm.capture.timeperframe.numerator = 1; |
1248 | sp->parm.capture.timeperframe.denominator = 30; | 1240 | sp->parm.capture.timeperframe.denominator = 30; |