diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-03-18 06:03:53 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-03-18 06:27:51 -0400 |
commit | 1313e7041480f523a09dedc7ef2185d8ee94c163 (patch) | |
tree | 76863f228d5ef6cc6d727bd91ef1483a067fbe6c /sound/usb/caiaq/caiaq-audio.c | |
parent | 238c0270baade3a542c1497712dd8e66cc9cc476 (diff) |
ALSA: snd-usb-caiaq: only warn once on streaming errors
Limit the number of printed warnings to one in case of streaming errors.
printk() happens to be expensive, especially in code called as often as
here.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/caiaq/caiaq-audio.c')
-rw-r--r-- | sound/usb/caiaq/caiaq-audio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/usb/caiaq/caiaq-audio.c b/sound/usb/caiaq/caiaq-audio.c index fc6d571eeac..577b1129de0 100644 --- a/sound/usb/caiaq/caiaq-audio.c +++ b/sound/usb/caiaq/caiaq-audio.c | |||
@@ -114,6 +114,7 @@ static int stream_start(struct snd_usb_caiaqdev *dev) | |||
114 | dev->output_panic = 0; | 114 | dev->output_panic = 0; |
115 | dev->first_packet = 1; | 115 | dev->first_packet = 1; |
116 | dev->streaming = 1; | 116 | dev->streaming = 1; |
117 | dev->warned = 0; | ||
117 | 118 | ||
118 | for (i = 0; i < N_URBS; i++) { | 119 | for (i = 0; i < N_URBS; i++) { |
119 | ret = usb_submit_urb(dev->data_urbs_in[i], GFP_ATOMIC); | 120 | ret = usb_submit_urb(dev->data_urbs_in[i], GFP_ATOMIC); |
@@ -406,10 +407,11 @@ static void read_in_urb(struct snd_usb_caiaqdev *dev, | |||
406 | break; | 407 | break; |
407 | } | 408 | } |
408 | 409 | ||
409 | if (dev->input_panic || dev->output_panic) { | 410 | if ((dev->input_panic || dev->output_panic) && !dev->warned) { |
410 | debug("streaming error detected %s %s\n", | 411 | debug("streaming error detected %s %s\n", |
411 | dev->input_panic ? "(input)" : "", | 412 | dev->input_panic ? "(input)" : "", |
412 | dev->output_panic ? "(output)" : ""); | 413 | dev->output_panic ? "(output)" : ""); |
414 | dev->warned = 1; | ||
413 | } | 415 | } |
414 | } | 416 | } |
415 | 417 | ||