aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/endpoint.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-02-26 07:02:17 -0500
committerTakashi Iwai <tiwai@suse.de>2014-02-26 10:45:34 -0500
commit0ba41d917eeb87f608cf147f870ff2f4c1056bab (patch)
treee848ad3bb355ec92150b7f22eab66e88d7eee34b /sound/usb/endpoint.c
parent6436bcf6a4a35ae83af9ff3c250435e5fd001205 (diff)
ALSA: usb-audio: Use standard printk helpers
Convert with dev_err() and co from snd_printk(), etc. As there are too deep indirections (e.g. ep->chip->dev->dev), a few new local macros, usb_audio_err() & co, are introduced. Also, the device numbers in some messages are dropped, as they are shown in the prefix automatically. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/endpoint.c')
-rw-r--r--sound/usb/endpoint.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 83aabea259d7..e70a87e0d9fe 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -333,8 +333,9 @@ static void queue_pending_output_urbs(struct snd_usb_endpoint *ep)
333 333
334 err = usb_submit_urb(ctx->urb, GFP_ATOMIC); 334 err = usb_submit_urb(ctx->urb, GFP_ATOMIC);
335 if (err < 0) 335 if (err < 0)
336 snd_printk(KERN_ERR "Unable to submit urb #%d: %d (urb %p)\n", 336 usb_audio_err(ep->chip,
337 ctx->index, err, ctx->urb); 337 "Unable to submit urb #%d: %d (urb %p)\n",
338 ctx->index, err, ctx->urb);
338 else 339 else
339 set_bit(ctx->index, &ep->active_mask); 340 set_bit(ctx->index, &ep->active_mask);
340 } 341 }
@@ -387,7 +388,7 @@ static void snd_complete_urb(struct urb *urb)
387 if (err == 0) 388 if (err == 0)
388 return; 389 return;
389 390
390 snd_printk(KERN_ERR "cannot submit urb (err = %d)\n", err); 391 usb_audio_err(ep->chip, "cannot submit urb (err = %d)\n", err);
391 //snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); 392 //snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
392 393
393exit_clear: 394exit_clear:
@@ -426,13 +427,14 @@ struct snd_usb_endpoint *snd_usb_add_endpoint(struct snd_usb_audio *chip,
426 if (ep->ep_num == ep_num && 427 if (ep->ep_num == ep_num &&
427 ep->iface == alts->desc.bInterfaceNumber && 428 ep->iface == alts->desc.bInterfaceNumber &&
428 ep->altsetting == alts->desc.bAlternateSetting) { 429 ep->altsetting == alts->desc.bAlternateSetting) {
429 snd_printdd(KERN_DEBUG "Re-using EP %x in iface %d,%d @%p\n", 430 usb_audio_dbg(ep->chip,
431 "Re-using EP %x in iface %d,%d @%p\n",
430 ep_num, ep->iface, ep->altsetting, ep); 432 ep_num, ep->iface, ep->altsetting, ep);
431 goto __exit_unlock; 433 goto __exit_unlock;
432 } 434 }
433 } 435 }
434 436
435 snd_printdd(KERN_DEBUG "Creating new %s %s endpoint #%x\n", 437 usb_audio_dbg(chip, "Creating new %s %s endpoint #%x\n",
436 is_playback ? "playback" : "capture", 438 is_playback ? "playback" : "capture",
437 type == SND_USB_ENDPOINT_TYPE_DATA ? "data" : "sync", 439 type == SND_USB_ENDPOINT_TYPE_DATA ? "data" : "sync",
438 ep_num); 440 ep_num);
@@ -496,8 +498,9 @@ static int wait_clear_urbs(struct snd_usb_endpoint *ep)
496 } while (time_before(jiffies, end_time)); 498 } while (time_before(jiffies, end_time));
497 499
498 if (alive) 500 if (alive)
499 snd_printk(KERN_ERR "timeout: still %d active urbs on EP #%x\n", 501 usb_audio_err(ep->chip,
500 alive, ep->ep_num); 502 "timeout: still %d active urbs on EP #%x\n",
503 alive, ep->ep_num);
501 clear_bit(EP_FLAG_STOPPING, &ep->flags); 504 clear_bit(EP_FLAG_STOPPING, &ep->flags);
502 505
503 return 0; 506 return 0;
@@ -794,8 +797,9 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
794 int err; 797 int err;
795 798
796 if (ep->use_count != 0) { 799 if (ep->use_count != 0) {
797 snd_printk(KERN_WARNING "Unable to change format on ep #%x: already in use\n", 800 usb_audio_warn(ep->chip,
798 ep->ep_num); 801 "Unable to change format on ep #%x: already in use\n",
802 ep->ep_num);
799 return -EBUSY; 803 return -EBUSY;
800 } 804 }
801 805
@@ -830,8 +834,9 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
830 err = -EINVAL; 834 err = -EINVAL;
831 } 835 }
832 836
833 snd_printdd(KERN_DEBUG "Setting params for ep #%x (type %d, %d urbs), ret=%d\n", 837 usb_audio_dbg(ep->chip,
834 ep->ep_num, ep->type, ep->nurbs, err); 838 "Setting params for ep #%x (type %d, %d urbs), ret=%d\n",
839 ep->ep_num, ep->type, ep->nurbs, err);
835 840
836 return err; 841 return err;
837} 842}
@@ -906,8 +911,9 @@ int snd_usb_endpoint_start(struct snd_usb_endpoint *ep, bool can_sleep)
906 911
907 err = usb_submit_urb(urb, GFP_ATOMIC); 912 err = usb_submit_urb(urb, GFP_ATOMIC);
908 if (err < 0) { 913 if (err < 0) {
909 snd_printk(KERN_ERR "cannot submit urb %d, error %d: %s\n", 914 usb_audio_err(ep->chip,
910 i, err, usb_error_string(err)); 915 "cannot submit urb %d, error %d: %s\n",
916 i, err, usb_error_string(err));
911 goto __error; 917 goto __error;
912 } 918 }
913 set_bit(i, &ep->active_mask); 919 set_bit(i, &ep->active_mask);