diff options
author | Adrian Knoth <adi@drcomp.erfurt.thur.de> | 2011-02-28 15:14:50 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-02-28 15:58:19 +0100 |
commit | 7c7102b7af1e5043ddb455f7fae307ed3b194074 (patch) | |
tree | 2049ad72d1ecab7c22be0d882e1244e26579571e | |
parent | 5027f347ffe6f719365ab13127106b52721676ff (diff) |
ALSA: hdspm - Fix midi port initialization
Depending on the model and the presence of a TCO module, the number of
midi ports varies. Some have 1 port (MADIface), some have 2 (default),
with TCO, there are 3.
Don't hardcode the number of midi ports to initialize.
This patch also fixes a boot lockup on MADIface.
[Coding-style fixes by tiwai]
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 78f6ab5dbdd8..0ed4b4e981d8 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -6291,8 +6291,10 @@ static int __devinit snd_hdspm_create_pcm(struct snd_card *card, static inline void snd_hdspm_initialize_midi_flush(struct hdspm * hdspm) { - snd_hdspm_flush_midi_input(hdspm, 0); - snd_hdspm_flush_midi_input(hdspm, 1); + int i; + + for (i = 0; i < hdspm->midiPorts; i++) + snd_hdspm_flush_midi_input(hdspm, i); } static int __devinit snd_hdspm_create_alsa_devices(struct snd_card *card, |