diff options
author | Jaroslav Kysela <perex@suse.cz> | 2005-01-03 13:18:07 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-01-03 13:18:07 +0100 |
commit | 392c48e825718bb15d421613971714b6f976bbc2 (patch) | |
tree | eb45f4300f6f75d7576415c7a7b319ff26a0f1e0 /sound | |
parent | b7d78f2963fabbd72b01b9fd5998ef44c20893d5 (diff) | |
download | history-392c48e825718bb15d421613971714b6f976bbc2.tar.gz |
[ALSA] Return -EBADFD when the device is disconnected
USB generic driver
The trigger callback returns -EBADFD when the device is disconnected.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/usbaudio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 1792a4fbf41f89..560b62de82b005 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -725,7 +725,7 @@ static int deactivate_urbs(snd_usb_substream_t *subs, int force, int can_sleep) subs->running = 0; if (!force && subs->stream->chip->shutdown) /* to be sure... */ - return 0; + return -EBADFD; async = !can_sleep && async_unlink; @@ -770,6 +770,9 @@ static int start_urbs(snd_usb_substream_t *subs, snd_pcm_runtime_t *runtime) unsigned int i; int err; + if (subs->stream->chip->shutdown) + return -EBADFD; + for (i = 0; i < subs->nurbs; i++) { snd_assert(subs->dataurb[i].urb, return -EINVAL); if (subs->ops.prepare(subs, runtime, subs->dataurb[i].urb) < 0) { |