aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/dice/dice-midi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire/dice/dice-midi.c')
-rw-r--r--sound/firewire/dice/dice-midi.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/sound/firewire/dice/dice-midi.c b/sound/firewire/dice/dice-midi.c
index 8ff6da3c51f7..84eca8a51a02 100644
--- a/sound/firewire/dice/dice-midi.c
+++ b/sound/firewire/dice/dice-midi.c
@@ -101,27 +101,18 @@ int snd_dice_create_midi(struct snd_dice *dice)
101 .close = midi_close, 101 .close = midi_close,
102 .trigger = midi_playback_trigger, 102 .trigger = midi_playback_trigger,
103 }; 103 };
104 __be32 reg;
105 struct snd_rawmidi *rmidi; 104 struct snd_rawmidi *rmidi;
106 struct snd_rawmidi_str *str; 105 struct snd_rawmidi_str *str;
107 unsigned int midi_in_ports, midi_out_ports; 106 unsigned int midi_in_ports, midi_out_ports;
107 int i;
108 int err; 108 int err;
109 109
110 /* 110 midi_in_ports = 0;
111 * Use the number of MIDI conformant data channel at current sampling 111 midi_out_ports = 0;
112 * transfer frequency. 112 for (i = 0; i < MAX_STREAMS; ++i) {
113 */ 113 midi_in_ports = max(midi_in_ports, dice->tx_midi_ports[i]);
114 err = snd_dice_transaction_read_tx(dice, TX_NUMBER_MIDI, 114 midi_out_ports = max(midi_out_ports, dice->rx_midi_ports[i]);
115 &reg, sizeof(reg)); 115 }
116 if (err < 0)
117 return err;
118 midi_in_ports = be32_to_cpu(reg);
119
120 err = snd_dice_transaction_read_rx(dice, RX_NUMBER_MIDI,
121 &reg, sizeof(reg));
122 if (err < 0)
123 return err;
124 midi_out_ports = be32_to_cpu(reg);
125 116
126 if (midi_in_ports + midi_out_ports == 0) 117 if (midi_in_ports + midi_out_ports == 0)
127 return 0; 118 return 0;