aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/pcm.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-11-21 02:30:48 -0500
committerTakashi Iwai <tiwai@suse.de>2012-11-21 05:43:56 -0500
commitb2eb950de2f09435d5156f4dc6d5dbf284cd97f3 (patch)
tree7d5724114c4f57503502a7dd4a86bc9573774669 /sound/usb/pcm.c
parentccc1696d527d64deb417bfa1ef9e479d10ad4f6b (diff)
ALSA: usb-audio: stop both data and sync endpoints asynchronously
As we are stopping the endpoints asynchronously now, it's better to trigger the stop of both data and sync endpoints and wait for pending stopping operations, instead of the sequential trigger-and-wait procedure. So the wait argument in snd_usb_endpoint_stop() is dropped, and it's expected that the caller synchronizes explicitly by calling snd_usb_endpoint_sync_pending_stop(). (Actually there is only one place calling this, so it was safe to change.) Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/pcm.c')
-rw-r--r--sound/usb/pcm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index d90604aa5137..4750d3d5c0cc 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -266,10 +266,15 @@ static int start_endpoints(struct snd_usb_substream *subs, bool can_sleep)
266static void stop_endpoints(struct snd_usb_substream *subs, bool wait) 266static void stop_endpoints(struct snd_usb_substream *subs, bool wait)
267{ 267{
268 if (test_and_clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags)) 268 if (test_and_clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags))
269 snd_usb_endpoint_stop(subs->sync_endpoint, wait); 269 snd_usb_endpoint_stop(subs->sync_endpoint);
270 270
271 if (test_and_clear_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags)) 271 if (test_and_clear_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags))
272 snd_usb_endpoint_stop(subs->data_endpoint, wait); 272 snd_usb_endpoint_stop(subs->data_endpoint);
273
274 if (wait) {
275 snd_usb_endpoint_sync_pending_stop(subs->sync_endpoint);
276 snd_usb_endpoint_sync_pending_stop(subs->data_endpoint);
277 }
273} 278}
274 279
275static int deactivate_endpoints(struct snd_usb_substream *subs) 280static int deactivate_endpoints(struct snd_usb_substream *subs)