summaryrefslogtreecommitdiff
path: root/sound/usb
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-09-13 08:20:43 +0200
committerTakashi Iwai <tiwai@suse.de>2018-10-04 20:13:17 +0200
commit6aea5702e27ebc85747d6e4943a0c378e1752be0 (patch)
treec14ccb05935b7390997e8f4c74a5f4d4b2ab3617 /sound/usb
parentcd3b7116b57527f659b96ff6988d2de3d448c5b3 (diff)
ALSA: rawmidi: A lightweight function to discard pending bytes
For discarding the pending bytes on rawmidi, we process with a loop of snd_rawmidi_transmit() which is just a waste of CPU power. Implement a lightweight API function to discard the pending bytes and the proceed the ring buffer instantly, and use it instead of open codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/midi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index dcfc546d81b9..b737f0ec77d0 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1175,8 +1175,7 @@ static void snd_usbmidi_output_trigger(struct snd_rawmidi_substream *substream,
if (port->ep->umidi->disconnected) {
/* gobble up remaining bytes to prevent wait in
* snd_rawmidi_drain_output */
- while (!snd_rawmidi_transmit_empty(substream))
- snd_rawmidi_transmit_ack(substream, 1);
+ snd_rawmidi_proceed(substream);
return;
}
tasklet_schedule(&port->ep->tasklet);