diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-05-27 20:32:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:07:17 -0400 |
commit | 7bb846afceafdaceb88d2ed2e861585d26e353b9 (patch) | |
tree | 73b266e5155236eb43e463f191edebd42b28c9c7 /drivers | |
parent | 1d0ba5f3784612fe6e91a12e0dec37c797d4f07c (diff) |
V4L/DVB (7946): videodev: small fixes for VIDIOC_G_FREQUENCY and VIDIOC_G_FMT
__video_do_ioctl incorrectly zeroed the tuner field of v4l2_frequency and
did not zero the full fmt union of v4l2_format.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/videodev.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 52c56678ee69..91fd6cbc60ca 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -883,16 +883,13 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
883 | case VIDIOC_G_FMT: | 883 | case VIDIOC_G_FMT: |
884 | { | 884 | { |
885 | struct v4l2_format *f = (struct v4l2_format *)arg; | 885 | struct v4l2_format *f = (struct v4l2_format *)arg; |
886 | enum v4l2_buf_type type=f->type; | ||
887 | 886 | ||
888 | memset(&f->fmt.pix,0,sizeof(f->fmt.pix)); | 887 | memset(f->fmt.raw_data, 0, sizeof(f->fmt.raw_data)); |
889 | f->type=type; | ||
890 | 888 | ||
891 | /* FIXME: Should be one dump per type */ | 889 | /* FIXME: Should be one dump per type */ |
892 | dbgarg (cmd, "type=%s\n", prt_names(type, | 890 | dbgarg(cmd, "type=%s\n", prt_names(f->type, v4l2_type_names)); |
893 | v4l2_type_names)); | ||
894 | 891 | ||
895 | switch (type) { | 892 | switch (f->type) { |
896 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: | 893 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: |
897 | if (vfd->vidioc_g_fmt_cap) | 894 | if (vfd->vidioc_g_fmt_cap) |
898 | ret=vfd->vidioc_g_fmt_cap(file, fh, f); | 895 | ret=vfd->vidioc_g_fmt_cap(file, fh, f); |
@@ -1688,16 +1685,17 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1688 | } | 1685 | } |
1689 | case VIDIOC_G_FREQUENCY: | 1686 | case VIDIOC_G_FREQUENCY: |
1690 | { | 1687 | { |
1691 | struct v4l2_frequency *p=arg; | 1688 | struct v4l2_frequency *p = arg; |
1689 | |||
1692 | if (!vfd->vidioc_g_frequency) | 1690 | if (!vfd->vidioc_g_frequency) |
1693 | break; | 1691 | break; |
1694 | 1692 | ||
1695 | memset(p,0,sizeof(*p)); | 1693 | memset(p->reserved, 0, sizeof(p->reserved)); |
1696 | 1694 | ||
1697 | ret=vfd->vidioc_g_frequency(file, fh, p); | 1695 | ret = vfd->vidioc_g_frequency(file, fh, p); |
1698 | if (!ret) | 1696 | if (!ret) |
1699 | dbgarg (cmd, "tuner=%d, type=%d, frequency=%d\n", | 1697 | dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", |
1700 | p->tuner,p->type,p->frequency); | 1698 | p->tuner, p->type, p->frequency); |
1701 | break; | 1699 | break; |
1702 | } | 1700 | } |
1703 | case VIDIOC_S_FREQUENCY: | 1701 | case VIDIOC_S_FREQUENCY: |