media: em28xx: Fix misplaced reset of dev->v4l::field_count
authorBen Hutchings <ben@decadent.org.uk>
Thu, 17 Jan 2019 00:25:58 +0000 (00:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Jan 2019 07:09:46 +0000 (08:09 +0100)
The backport of commit afeaade90db4 "media: em28xx: make
v4l2-compliance happier by starting sequence on zero" added a
reset on em28xx_v4l2::field_count to em28xx_enable_analog_tuner()
but it should be done in em28xx_start_analog_streaming().

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/em28xx/em28xx-video.c

index 92a74bc34527becdf7dbbf56b2a7c629f0b47ee9..bd8de78e0ffd63d948d3a1d438974434a5bcf1fd 100644 (file)
@@ -900,8 +900,6 @@ static int em28xx_enable_analog_tuner(struct em28xx *dev)
        if (!mdev || !v4l2->decoder)
                return 0;
 
-       dev->v4l2->field_count = 0;
-
        /*
         * This will find the tuner that is connected into the decoder.
         * Technically, this is not 100% correct, as the device may be
@@ -1074,6 +1072,8 @@ int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count)
 
        em28xx_videodbg("%s\n", __func__);
 
+       dev->v4l2->field_count = 0;
+
        /* Make sure streaming is not already in progress for this type
           of filehandle (e.g. video, vbi) */
        rc = res_get(dev, vq->type);