2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-24 05:04:00 +08:00

[media] v4l2-ioctl.c: fix enum_freq_bands handling

If the driver supports enum_freq_bands, but only for certain device
nodes, then it may return -ENOTTY. But in that case the code should
fall into the fall-back case where the current tuner/modulator range
is returned.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This commit is contained in:
Hans Verkuil 2014-07-11 07:01:39 -03:00 committed by Mauro Carvalho Chehab
parent ce71bbc91e
commit a7f404af8a

View File

@ -2042,8 +2042,11 @@ static int v4l_enum_freq_bands(const struct v4l2_ioctl_ops *ops,
if (type != p->type) if (type != p->type)
return -EINVAL; return -EINVAL;
} }
if (ops->vidioc_enum_freq_bands) if (ops->vidioc_enum_freq_bands) {
return ops->vidioc_enum_freq_bands(file, fh, p); err = ops->vidioc_enum_freq_bands(file, fh, p);
if (err != -ENOTTY)
return err;
}
if (is_valid_ioctl(vfd, VIDIOC_G_TUNER)) { if (is_valid_ioctl(vfd, VIDIOC_G_TUNER)) {
struct v4l2_tuner t = { struct v4l2_tuner t = {
.index = p->tuner, .index = p->tuner,