[media] em28xx-audio: Properly report failures to start stream
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 19 Jun 2011 13:15:35 +0000 (10:15 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:53:04 +0000 (17:53 -0300)
If the audio stream fails for any reason, it should:
1) Report an error via dmesg;
2) Mark internally that the stream didn't started.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/em28xx/em28xx-audio.c

index 56739a4..5381f6d 100644 (file)
@@ -213,9 +213,12 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
        for (i = 0; i < EM28XX_AUDIO_BUFS; i++) {
                errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
                if (errCode) {
+                       em28xx_errdev("submit of audio urb failed\n");
                        em28xx_deinit_isoc_audio(dev);
+                       atomic_set(&dev->stream_started, 0);
                        return errCode;
                }
+
        }
 
        return 0;