From: Hans Verkuil Date: Fri, 11 Jul 2014 10:01:39 +0000 (-0300) Subject: [media] v4l2-ioctl.c: fix enum_freq_bands handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a7f404af8a435b940055a04be19a3304da93a76d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index cd9e94c37808..aef588cf6d44 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2042,8 +2042,11 @@ static int v4l_enum_freq_bands(const struct v4l2_ioctl_ops *ops, if (type != p->type) return -EINVAL; } - if (ops->vidioc_enum_freq_bands) - return ops->vidioc_enum_freq_bands(file, fh, p); + if (ops->vidioc_enum_freq_bands) { + err = ops->vidioc_enum_freq_bands(file, fh, p); + if (err != -ENOTTY) + return err; + } if (is_valid_ioctl(vfd, VIDIOC_G_TUNER)) { struct v4l2_tuner t = { .index = p->tuner,