From: Takashi Iwai Subject: Re: [PATCH v4 15/15] ALSA: usb-audio: improve logging messages Date: Mon, 07 Oct 2013 11:23:41 +0200 Message-ID: References: <1381091480-23636-1-git-send-email-eldad@fogrefinery.com> <1381091480-23636-16-git-send-email-eldad@fogrefinery.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 7F451261ADE for ; Mon, 7 Oct 2013 11:21:07 +0200 (CEST) In-Reply-To: <1381091480-23636-16-git-send-email-eldad@fogrefinery.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Eldad Zack Cc: Nikolay Martynov , Clemens Ladisch , alsa-devel@alsa-project.org, Daniel Mack List-Id: alsa-devel@alsa-project.org At Sun, 6 Oct 2013 22:31:20 +0200, Eldad Zack wrote: > > Add -EBUSY to the list of returned USB error strings. > Change some debugging messages to KERN_DEBUG. snd_printdd() implies KERN_DEBUG as default, so it's superfluous. Takashi > Add the calling function for usb_submit_urb related errors. > > Signed-off-by: Eldad Zack > --- > sound/usb/endpoint.c | 12 +++++++----- > sound/usb/pcm.c | 4 ++-- > 2 files changed, 9 insertions(+), 7 deletions(-) > > diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c > index 81056b6..ac4dedf 100644 > --- a/sound/usb/endpoint.c > +++ b/sound/usb/endpoint.c > @@ -114,6 +114,8 @@ static const char *usb_error_string(int err) > case -EFBIG: > case -EMSGSIZE: > return "internal error"; > + case -EBUSY: > + return "device busy"; > default: > return "unknown error"; > } > @@ -333,8 +335,8 @@ static void queue_pending_output_urbs(struct snd_usb_endpoint *ep) > > err = usb_submit_urb(ctx->urb, GFP_ATOMIC); > if (err < 0) > - snd_printk(KERN_ERR "Unable to submit urb #%d: %d (urb %p)\n", > - ctx->index, err, ctx->urb); > + snd_printk(KERN_ERR "%s: cannot submit urb #%d: %d (urb %p)\n", > + __func__, ctx->index, err, ctx->urb); > else > set_bit(ctx->index, &ep->active_mask); > } > @@ -387,7 +389,7 @@ static void snd_complete_urb(struct urb *urb) > if (err == 0) > return; > > - snd_printk(KERN_ERR "cannot submit urb (err = %d)\n", err); > + snd_printk(KERN_ERR "%s: cannot submit urb (err = %d)\n", __func__, err); > //snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); > > exit_clear: > @@ -948,8 +950,8 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep) > > err = usb_submit_urb(urb, GFP_ATOMIC); > if (err < 0) { > - snd_printk(KERN_ERR "cannot submit urb %d, error %d: %s\n", > - i, err, usb_error_string(err)); > + snd_printk(KERN_ERR "%s: cannot submit urb %d, error %d: %s\n", > + __func__, i, err, usb_error_string(err)); > goto __error; > } > set_bit(i, &ep->active_mask); > diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c > index f3d48d4..8897da7 100644 > --- a/sound/usb/pcm.c > +++ b/sound/usb/pcm.c > @@ -606,7 +606,7 @@ static int match_endpoint_audioformats(struct audioformat *fp, > if (fp->channels == match->channels) > score++; > > - snd_printdd("%s: (fmt @%p) score %d\n", __func__, fp, score); > + snd_printdd(KERN_DEBUG "%s: (fmt @%p) score %d\n", __func__, fp, score); > > return score; > } > @@ -660,7 +660,7 @@ static int configure_sync_endpoint(struct snd_usb_substream *subs) > if (sync_fp->channels != subs->channels) { > sync_period_bytes = (subs->period_bytes / subs->channels) * > sync_fp->channels; > - snd_printdd("%s: adjusted sync ep period bytes (%d -> %d)\n", > + snd_printdd(KERN_DEBUG "%s: adjusted sync ep period bytes (%d -> %d)\n", > __func__, subs->period_bytes, sync_period_bytes); > } > > -- > 1.8.1.5 >