/* Returns the copied size if successful, or a negative error code on failure.  */
int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, unsigned char *buffer, int count)
/* Returns the copied size if successful, or a negative error code on failure.  */
int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, unsigned char *buffer, int count)
{
	if (!substream->opened)
		return -EBADFD;
	count = snd_rawmidi_transmit_peek(substream, buffer, count);
	if (count < 0)
		return count;
	return snd_rawmidi_transmit_ack(substream, count);
}