/* Get the bank number assigned to the channel  */
static int get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan)
/* Get the bank number assigned to the channel  */
static int get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan)
{
	int val;
	switch (port->chset.midi_mode) {
	case SNDRV_MIDI_MODE_XG:
		val = chan->control[MIDI_CTL_MSB_BANK];
		if (val == 127)
			return 128;
		return chan->control[MIDI_CTL_LSB_BANK];
	case SNDRV_MIDI_MODE_GS:
		if (chan->drum_channel)
			return 128;
		return chan->control[MIDI_CTL_MSB_BANK];
	default:
		if (chan->drum_channel)
			return 128;
		return chan->control[MIDI_CTL_MSB_BANK];
	}
}