summaryrefslogtreecommitdiff
path: root/sound/usb/line6/playback.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-01-23 18:18:42 +0300
committerTakashi Iwai <tiwai@suse.de>2015-01-28 09:21:27 +0300
commitd8131e67f08bc15e54104cb69deb06bad9d87f30 (patch)
tree612f830a3ea36af5c3bb2249aa5e2d779dbaaa2e /sound/usb/line6/playback.c
parentad0119abe29fe3d506486a789de4c4619fa7602c (diff)
downloadlinux-d8131e67f08bc15e54104cb69deb06bad9d87f30.tar.xz
ALSA: line6: Consolidate URB unlink and sync helpers
The codes to unlink and sync URBs are identical for both playback and capture streams. Consolidate to single helper functions. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/line6/playback.c')
-rw-r--r--sound/usb/line6/playback.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/sound/usb/line6/playback.c b/sound/usb/line6/playback.c
index d619c1718306..3820ed08b342 100644
--- a/sound/usb/line6/playback.c
+++ b/sound/usb/line6/playback.c
@@ -290,58 +290,6 @@ int line6_submit_audio_out_all_urbs(struct snd_line6_pcm *line6pcm)
return 0;
}
-/*
- Unlink all currently active playback URBs.
-*/
-void line6_unlink_audio_out_urbs(struct snd_line6_pcm *line6pcm)
-{
- unsigned int i;
-
- for (i = 0; i < LINE6_ISO_BUFFERS; i++) {
- if (test_bit(i, &line6pcm->out.active_urbs)) {
- if (!test_and_set_bit(i, &line6pcm->out.unlink_urbs)) {
- struct urb *u = line6pcm->out.urbs[i];
-
- usb_unlink_urb(u);
- }
- }
- }
-}
-
-/*
- Wait until unlinking of all currently active playback URBs has been
- finished.
-*/
-void line6_wait_clear_audio_out_urbs(struct snd_line6_pcm *line6pcm)
-{
- int timeout = HZ;
- unsigned int i;
- int alive;
-
- do {
- alive = 0;
- for (i = 0; i < LINE6_ISO_BUFFERS; i++) {
- if (test_bit(i, &line6pcm->out.active_urbs))
- alive++;
- }
- if (!alive)
- break;
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(1);
- } while (--timeout > 0);
- if (alive)
- snd_printk(KERN_ERR "timeout: still %d active urbs..\n", alive);
-}
-
-/*
- Unlink all currently active playback URBs, and wait for finishing.
-*/
-void line6_unlink_wait_clear_audio_out_urbs(struct snd_line6_pcm *line6pcm)
-{
- line6_unlink_audio_out_urbs(line6pcm);
- line6_wait_clear_audio_out_urbs(line6pcm);
-}
-
void line6_free_playback_buffer(struct snd_line6_pcm *line6pcm)
{
kfree(line6pcm->out.buffer);