* USB <- IN endpoint <- rawmidi
*/
struct gmidi_in_port {
+ struct snd_rawmidi_substream *substream;
int active;
uint8_t cable;
uint8_t state;
struct snd_rawmidi *rmidi;
u8 ms_id;
- struct snd_rawmidi_substream *in_substream[MAX_PORTS];
struct snd_rawmidi_substream *out_substream[MAX_PORTS];
unsigned long out_triggered;
for (i = 0; i < midi->in_ports; i++) {
struct gmidi_in_port *port = midi->in_ports_array + i;
- struct snd_rawmidi_substream *substream = midi->in_substream[i];
+ struct snd_rawmidi_substream *substream = port->substream;
if (port->active && substream)
snd_rawmidi_drop_output(substream);
}
for (i = midi->in_last_port; i < midi->in_ports; ++i) {
struct gmidi_in_port *port = midi->in_ports_array + i;
- struct snd_rawmidi_substream *substream = midi->in_substream[i];
+ struct snd_rawmidi_substream *substream = port->substream;
if (!port->active || !substream)
continue;
static int f_midi_in_open(struct snd_rawmidi_substream *substream)
{
struct f_midi *midi = substream->rmidi->private_data;
+ struct gmidi_in_port *port;
if (substream->number >= midi->in_ports)
return -EINVAL;
VDBG(midi, "%s()\n", __func__);
- midi->in_substream[substream->number] = substream;
- midi->in_ports_array[substream->number].state = STATE_UNKNOWN;
+ port = midi->in_ports_array + substream->number;
+ port->substream = substream;
+ port->state = STATE_UNKNOWN;
return 0;
}