]> git.hungrycats.org Git - linux/commitdiff
media: em28xx: fix VBI handling logic
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 19 Sep 2014 16:02:12 +0000 (13:02 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 20:41:10 +0000 (13:41 -0700)
commit c7854c2c5d692a329b4d9a9a73bcf36ae137ee7c upstream.

When both VBI and video are streaming, and video stream is stopped,
a subsequent trial to restart it will fail, because S_FMT will
return -EBUSY.

That prevents applications like zvbi to work properly.

Please notice that, while this fix it fully for zvbi, the
best is to get rid of streaming_users and res_get logic as a hole.

However, this single-line patch is better to be merged at -stable.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/em28xx/em28xx-video.c

index f6b49c98e2c9f0d488cbadbfc7c4ef1b53b432ef..408c072ce2287f9c1a6ee0886bf9a4c89752b215 100644 (file)
@@ -1344,7 +1344,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
        struct em28xx *dev = video_drvdata(file);
        struct em28xx_v4l2 *v4l2 = dev->v4l2;
 
-       if (v4l2->streaming_users > 0)
+       if (vb2_is_busy(&v4l2->vb_vidq))
                return -EBUSY;
 
        vidioc_try_fmt_vid_cap(file, priv, f);