Commit 392c48e8 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] Return -EBADFD when the device is disconnected

USB generic driver
The trigger callback returns -EBADFD when the device is disconnected.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent b7d78f29
...@@ -725,7 +725,7 @@ static int deactivate_urbs(snd_usb_substream_t *subs, int force, int can_sleep) ...@@ -725,7 +725,7 @@ static int deactivate_urbs(snd_usb_substream_t *subs, int force, int can_sleep)
subs->running = 0; subs->running = 0;
if (!force && subs->stream->chip->shutdown) /* to be sure... */ if (!force && subs->stream->chip->shutdown) /* to be sure... */
return 0; return -EBADFD;
async = !can_sleep && async_unlink; async = !can_sleep && async_unlink;
...@@ -770,6 +770,9 @@ static int start_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) ...@@ -770,6 +770,9 @@ static int start_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime)
unsigned int i; unsigned int i;
int err; int err;
if (subs->stream->chip->shutdown)
return -EBADFD;
for (i = 0; i < subs->nurbs; i++) { for (i = 0; i < subs->nurbs; i++) {
snd_assert(subs->dataurb[i].urb, return -EINVAL); snd_assert(subs->dataurb[i].urb, return -EINVAL);
if (subs->ops.prepare(subs, runtime, subs->dataurb[i].urb) < 0) { if (subs->ops.prepare(subs, runtime, subs->dataurb[i].urb) < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment