Commit 257d2d7e authored by Takashi Iwai's avatar Takashi Iwai

ALSA: usb-audio: Don't avoid stopping the stream at disconnection

In the later patch, we're going to issue the PCM sync_stop calls at
disconnection.  But currently the USB-audio driver can't handle it
because it has a check of shutdown flag for stopping the URBs.  This
is basically superfluous (the stopping URBs are safe at disconnection
state), so let's drop the check.

Fixes: dc5eafe7 ("ALSA: usb-audio: Support PCM sync_stop")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210206203052.15606-4-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 5c2b3014
...@@ -890,9 +890,6 @@ static int stop_urbs(struct snd_usb_endpoint *ep, bool force) ...@@ -890,9 +890,6 @@ static int stop_urbs(struct snd_usb_endpoint *ep, bool force)
{ {
unsigned int i; unsigned int i;
if (!force && atomic_read(&ep->chip->shutdown)) /* to be sure... */
return -EBADFD;
if (!force && atomic_read(&ep->running)) if (!force && atomic_read(&ep->running))
return -EBUSY; return -EBUSY;
......
...@@ -270,10 +270,7 @@ static int snd_usb_pcm_sync_stop(struct snd_pcm_substream *substream) ...@@ -270,10 +270,7 @@ static int snd_usb_pcm_sync_stop(struct snd_pcm_substream *substream)
{ {
struct snd_usb_substream *subs = substream->runtime->private_data; struct snd_usb_substream *subs = substream->runtime->private_data;
if (!snd_usb_lock_shutdown(subs->stream->chip)) { sync_pending_stops(subs);
sync_pending_stops(subs);
snd_usb_unlock_shutdown(subs->stream->chip);
}
return 0; return 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