diff options
Diffstat (limited to 'drivers/media/video/videodev.c')
-rw-r--r-- | drivers/media/video/videodev.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 479a0675cf60..d424a4129d69 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -17,10 +17,11 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define dbgarg(cmd, fmt, arg...) \ | 19 | #define dbgarg(cmd, fmt, arg...) \ |
20 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ | 20 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { \ |
21 | printk (KERN_DEBUG "%s: ", vfd->name); \ | 21 | printk (KERN_DEBUG "%s: ", vfd->name); \ |
22 | v4l_printk_ioctl(cmd); \ | 22 | v4l_printk_ioctl(cmd); \ |
23 | printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg); | 23 | printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg); \ |
24 | } | ||
24 | 25 | ||
25 | #define dbgarg2(fmt, arg...) \ | 26 | #define dbgarg2(fmt, arg...) \ |
26 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ | 27 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ |
@@ -1287,6 +1288,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1287 | ret=vfd->vidioc_g_parm(file, fh, p); | 1288 | ret=vfd->vidioc_g_parm(file, fh, p); |
1288 | } else { | 1289 | } else { |
1289 | struct v4l2_standard s; | 1290 | struct v4l2_standard s; |
1291 | int i; | ||
1290 | 1292 | ||
1291 | if (!vfd->tvnormsize) { | 1293 | if (!vfd->tvnormsize) { |
1292 | printk (KERN_WARNING "%s: no TV norms defined!\n", | 1294 | printk (KERN_WARNING "%s: no TV norms defined!\n", |
@@ -1297,8 +1299,14 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1297 | if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | 1299 | if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) |
1298 | return -EINVAL; | 1300 | return -EINVAL; |
1299 | 1301 | ||
1300 | v4l2_video_std_construct(&s, vfd->tvnorms[vfd->current_norm].id, | 1302 | for (i = 0; i < vfd->tvnormsize; i++) |
1301 | vfd->tvnorms[vfd->current_norm].name); | 1303 | if (vfd->tvnorms[i].id == vfd->current_norm) |
1304 | break; | ||
1305 | if (i >= vfd->tvnormsize) | ||
1306 | return -EINVAL; | ||
1307 | |||
1308 | v4l2_video_std_construct(&s, vfd->current_norm, | ||
1309 | vfd->tvnorms[i].name); | ||
1302 | 1310 | ||
1303 | memset(p,0,sizeof(*p)); | 1311 | memset(p,0,sizeof(*p)); |
1304 | 1312 | ||