diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-09-15 13:08:20 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2009-09-15 13:08:20 +0200 |
commit | aeb3a788273d65fa47c79635a886bcafc7970807 (patch) | |
tree | 585cbba1c42419680144dd722dbff568c9cf1b5f | |
parent | a4cdff6e818518532b51aeca271ece2537b4222c (diff) | |
download | mediapointer-dvb-s2-aeb3a788273d65fa47c79635a886bcafc7970807.tar.gz mediapointer-dvb-s2-aeb3a788273d65fa47c79635a886bcafc7970807.tar.bz2 |
v4l1-compat: fix VIDIOC_G_STD handling
From: Hans Verkuil <hverkuil@xs4all.nl>
The VIDIOC_G_STD ioctl may not be present in the case of radio receivers.
In that case G_STD will return an error. The v4l1-compat layer should not
attempt to propagate that error to the caller, instead it should be
ignored.
Priority: high
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r-- | linux/drivers/media/video/v4l1-compat.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/linux/drivers/media/video/v4l1-compat.c b/linux/drivers/media/video/v4l1-compat.c index 2225243ad..12e295750 100644 --- a/linux/drivers/media/video/v4l1-compat.c +++ b/linux/drivers/media/video/v4l1-compat.c @@ -565,10 +565,9 @@ static noinline long v4l1_compat_get_input_info( break; } chan->norm = 0; - err = drv(file, VIDIOC_G_STD, &sid); - if (err < 0) - dprintk("VIDIOCGCHAN / VIDIOC_G_STD: %ld\n", err); - if (err == 0) { + /* Note: G_STD might not be present for radio receivers, + * so we should ignore any errors. */ + if (drv(file, VIDIOC_G_STD, &sid) == 0) { if (sid & V4L2_STD_PAL) chan->norm = VIDEO_MODE_PAL; if (sid & V4L2_STD_NTSC) @@ -777,10 +776,9 @@ static noinline long v4l1_compat_get_tuner( tun->flags |= VIDEO_TUNER_SECAM; } - err = drv(file, VIDIOC_G_STD, &sid); - if (err < 0) - dprintk("VIDIOCGTUNER / VIDIOC_G_STD: %ld\n", err); - if (err == 0) { + /* Note: G_STD might not be present for radio receivers, + * so we should ignore any errors. */ + if (drv(file, VIDIOC_G_STD, &sid) == 0) { if (sid & V4L2_STD_PAL) tun->mode = VIDEO_MODE_PAL; if (sid & V4L2_STD_NTSC) |