diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-01-19 16:15:54 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-20 08:18:44 +0100 |
commit | 5a4753112afc4d418ec6023bac757a9ec3eb7a32 (patch) | |
tree | 10c14a44a9d96003746c68968d2006ae98d10a49 /sound/usb/line6/pcm.c | |
parent | ALSA: line6: Remove superfluous disconnect call in suspend handler (diff) | |
download | linux-5a4753112afc4d418ec6023bac757a9ec3eb7a32.tar.xz linux-5a4753112afc4d418ec6023bac757a9ec3eb7a32.zip |
ALSA: line6: Sync PCM stop at disconnect
Call line6_pcm_disconnect() at disconnect to make sure that all URBs
are cleared. Also reduce the superfluous snd_pcm_stop() calls from
the function (and remove the unused function) since the streams are
guaranteed to be stopped at this point via snd_card_disconnect().
Tested-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/line6/pcm.c')
-rw-r--r-- | sound/usb/line6/pcm.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c index 39034c7681da..08fa9753a680 100644 --- a/sound/usb/line6/pcm.c +++ b/sound/usb/line6/pcm.c @@ -379,30 +379,13 @@ static int snd_line6_new_pcm(struct usb_line6 *line6, struct snd_pcm **pcm_ret) } /* - Stop substream if still running. -*/ -static void pcm_disconnect_substream(struct snd_pcm_substream *substream) -{ - if (substream->runtime && snd_pcm_running(substream)) { - snd_pcm_stream_lock_irq(substream); - snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED); - snd_pcm_stream_unlock_irq(substream); - } -} - -/* - Stop PCM stream. + Sync with PCM stream stops. */ void line6_pcm_disconnect(struct snd_line6_pcm *line6pcm) { - pcm_disconnect_substream(get_substream - (line6pcm, SNDRV_PCM_STREAM_CAPTURE)); - pcm_disconnect_substream(get_substream - (line6pcm, SNDRV_PCM_STREAM_PLAYBACK)); line6_unlink_wait_clear_audio_out_urbs(line6pcm); line6_unlink_wait_clear_audio_in_urbs(line6pcm); } -EXPORT_SYMBOL_GPL(line6_pcm_disconnect); /* Create and register the PCM device and mixer entries. |