From e93e890e16ef5a0605b7cdc52b3bde50d88d7207 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 23 Nov 2020 09:53:13 +0100 Subject: ALSA: usb-audio: Improve some debug prints There are a few rooms for improvements wrt the debug prints: - The EP debug print is shown only at starting, not at stopping - The EP debug print contains useless object addresses - Some helpers show the urb and the EP object addresses, too This patch addresses those shortcomings. Tested-by: Keith Milner Tested-by: Dylan Robinson Link: https://lore.kernel.org/r/20201123085347.19667-8-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/usb/pcm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sound/usb/pcm.c') diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 8800ec627a73..8f4fe65d5c37 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -218,7 +218,7 @@ static int start_endpoints(struct snd_usb_substream *subs) if (!test_and_set_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags)) { struct snd_usb_endpoint *ep = subs->data_endpoint; - dev_dbg(&subs->dev->dev, "Starting data EP @%p\n", ep); + dev_dbg(&subs->dev->dev, "Starting data EP 0x%x\n", ep->ep_num); ep->data_subs = subs; err = snd_usb_endpoint_start(ep); @@ -232,7 +232,7 @@ static int start_endpoints(struct snd_usb_substream *subs) !test_and_set_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags)) { struct snd_usb_endpoint *ep = subs->sync_endpoint; - dev_dbg(&subs->dev->dev, "Starting sync EP @%p\n", ep); + dev_dbg(&subs->dev->dev, "Starting sync EP 0x%x\n", ep->ep_num); ep->sync_slave = subs->data_endpoint; err = snd_usb_endpoint_start(ep); @@ -255,12 +255,17 @@ static void sync_pending_stops(struct snd_usb_substream *subs) static void stop_endpoints(struct snd_usb_substream *subs) { if (test_and_clear_bit(SUBSTREAM_FLAG_SYNC_EP_STARTED, &subs->flags)) { + dev_dbg(&subs->dev->dev, "Stopping sync EP 0x%x\n", + subs->sync_endpoint->ep_num); snd_usb_endpoint_stop(subs->sync_endpoint); subs->sync_endpoint->sync_slave = NULL; } - if (test_and_clear_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags)) + if (test_and_clear_bit(SUBSTREAM_FLAG_DATA_EP_STARTED, &subs->flags)) { + dev_dbg(&subs->dev->dev, "Stopping data EP 0x%x\n", + subs->data_endpoint->ep_num); snd_usb_endpoint_stop(subs->data_endpoint); + } } /* PCM sync_stop callback */ -- cgit v1.2.3