From: Hans Verkuil <hans.verk...@cisco.com>

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.verk...@cisco.com>
---
 drivers/media/v4l2-core/v4l2-ioctl.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index 45e2ffa..afed070 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1979,8 +1979,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,
-- 
2.0.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to