/* Returns 1 if the internal output buffer is empty, 0 if not.  */
int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream)
/* Returns 1 if the internal output buffer is empty, 0 if not.  */
int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream)
{
	struct snd_rawmidi_runtime *runtime = substream->runtime;
	int result;
	unsigned long flags;
	if (runtime->buffer == NULL) {
		snd_printd("snd_rawmidi_transmit_empty: output is not active!!!\n");
		return 1;
	}
	spin_lock_irqsave(&runtime->lock, flags);
	result = runtime->avail >= runtime->buffer_size;
	spin_unlock_irqrestore(&runtime->lock, flags);
	return result;}