summaryrefslogtreecommitdiff
path: root/sound/usb/endpoint.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-11-23 09:53:27 +0100
committerTakashi Iwai <tiwai@suse.de>2020-11-23 15:14:36 +0100
commit57234bc1038517437d5c589595caf77b2118529e (patch)
tree338117bd31306f490d543ae740d56f34be7aa7ce /sound/usb/endpoint.c
parent73037c8dc1c8cf994a38fedba4a5af7e6da5e4f1 (diff)
ALSA: usb-audio: Stop both endpoints properly at error
start_endpoints() may leave the data endpoint running if an error happens at starting the sync endpoint. We should stop both streams properly, instead. While we're at it, move the debug prints into the endpoint.c that is a more suitable place. Tested-by: Keith Milner <kamilner@superlative.org> Tested-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-22-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/endpoint.c')
-rw-r--r--sound/usb/endpoint.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index eb459db511f8..0cc7e9c01263 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -1172,6 +1172,9 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep)
if (atomic_read(&ep->chip->shutdown))
return -EBADFD;
+ usb_audio_dbg(ep->chip, "Starting %s EP 0x%x (count %d)\n",
+ ep_type_name(ep->type), ep->ep_num, ep->use_count);
+
/* already running? */
if (++ep->use_count != 1)
return 0;
@@ -1254,6 +1257,9 @@ void snd_usb_endpoint_stop(struct snd_usb_endpoint *ep)
if (!ep)
return;
+ usb_audio_dbg(ep->chip, "Stopping %s EP 0x%x (count %d)\n",
+ ep_type_name(ep->type), ep->ep_num, ep->use_count);
+
if (snd_BUG_ON(ep->use_count == 0))
return;