]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] em28xx-audio: fix return code on device disconnect
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 12 Jan 2014 15:57:08 +0000 (12:57 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 14 Jan 2014 16:34:23 +0000 (14:34 -0200)
Alsa has an special non-negative return code to indicate device removal
at snd_em28xx_capture_pointer(). Use it, instead of an error code.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/em28xx/em28xx-audio.c

index f3e320098f79b3df6859448c4cec51386de541fc..47766b796acb069d2d5fb51c2ce46b621710c57e 100644 (file)
@@ -434,7 +434,7 @@ static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream
 
        dev = snd_pcm_substream_chip(substream);
        if (dev->disconnected)
-               return -ENODEV;
+               return SNDRV_PCM_POS_XRUN;
 
        spin_lock_irqsave(&dev->adev.slock, flags);
        hwptr_done = dev->adev.hwptr_done_capture;