summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-05-27 23:32:08 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-05-27 23:32:08 +0200
commit4c4ffaaff72aa78fdd1b96d73fe1eb265b5f2d07 (patch)
treec96e48e6dc3aca6cfbf724227780726642b18d00 /linux
parent207a3ddc145923e40cc3d7d1bc7d4d96671fa67e (diff)
downloadmediapointer-dvb-s2-4c4ffaaff72aa78fdd1b96d73fe1eb265b5f2d07.tar.gz
mediapointer-dvb-s2-4c4ffaaff72aa78fdd1b96d73fe1eb265b5f2d07.tar.bz2
videodev: small fixes for VIDIOC_G_FREQUENCY and VIDIOC_G_FMT
From: Hans Verkuil <hverkuil@xs4all.nl> __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>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/videodev.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c
index 684c7e4b9..b2291e085 100644
--- a/linux/drivers/media/video/videodev.c
+++ b/linux/drivers/media/video/videodev.c
@@ -970,16 +970,13 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
case VIDIOC_G_FMT:
{
struct v4l2_format *f = (struct v4l2_format *)arg;
- enum v4l2_buf_type type=f->type;
- memset(&f->fmt.pix,0,sizeof(f->fmt.pix));
- f->type=type;
+ memset(f->fmt.raw_data, 0, sizeof(f->fmt.raw_data));
/* FIXME: Should be one dump per type */
- dbgarg (cmd, "type=%s\n", prt_names(type,
- v4l2_type_names));
+ dbgarg(cmd, "type=%s\n", prt_names(f->type, v4l2_type_names));
- switch (type) {
+ switch (f->type) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
if (vfd->vidioc_g_fmt_cap)
ret=vfd->vidioc_g_fmt_cap(file, fh, f);
@@ -1830,16 +1827,17 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
}
case VIDIOC_G_FREQUENCY:
{
- struct v4l2_frequency *p=arg;
+ struct v4l2_frequency *p = arg;
+
if (!vfd->vidioc_g_frequency)
break;
- memset(p,0,sizeof(*p));
+ memset(p->reserved, 0, sizeof(p->reserved));
- ret=vfd->vidioc_g_frequency(file, fh, p);
+ ret = vfd->vidioc_g_frequency(file, fh, p);
if (!ret)
- dbgarg (cmd, "tuner=%d, type=%d, frequency=%d\n",
- p->tuner,p->type,p->frequency);
+ dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n",
+ p->tuner, p->type, p->frequency);
break;
}
case VIDIOC_S_FREQUENCY: