diff options
author | Alan Horstmann <gineera@aspect135.co.uk> | 2006-05-03 11:07:29 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-06-22 15:33:26 -0400 |
commit | 520290e43f9880da34e542185838816c6d79a340 (patch) | |
tree | bf98333a95a459ea41dbe05b5d56785061ae3525 | |
parent | a59524faf3a2050e14a1c9038eb006ce96025394 (diff) |
[ALSA] au88x0 - Init before create components
Change the order in vortex_probe to set the card details before creating the
components, meaning for example that card->shortname is available when
registering the midi port.
I have also added extra to card->shortname, and a line to overwrite the midi
name following snd_mpu401_uart_new.
Signed-off-by: Alan Horstmann <gineera@aspect135.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/au88x0/au88x0.c | 12 | ||||
-rw-r--r-- | sound/pci/au88x0/au88x0_mpu401.c | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c index 126870ec063a..8a3b118989bf 100644 --- a/sound/pci/au88x0/au88x0.c +++ b/sound/pci/au88x0/au88x0.c | |||
@@ -261,6 +261,13 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) | |||
261 | return err; | 261 | return err; |
262 | } | 262 | } |
263 | snd_vortex_workaround(pci, pcifix[dev]); | 263 | snd_vortex_workaround(pci, pcifix[dev]); |
264 | |||
265 | // Card details needed in snd_vortex_midi | ||
266 | strcpy(card->driver, CARD_NAME_SHORT); | ||
267 | sprintf(card->shortname, "Aureal Vortex %s", CARD_NAME_SHORT); | ||
268 | sprintf(card->longname, "%s at 0x%lx irq %i", | ||
269 | card->shortname, chip->io, chip->irq); | ||
270 | |||
264 | // (4) Alloc components. | 271 | // (4) Alloc components. |
265 | // ADB pcm. | 272 | // ADB pcm. |
266 | if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) { | 273 | if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) { |
@@ -323,11 +330,6 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) | |||
323 | #endif | 330 | #endif |
324 | 331 | ||
325 | // (5) | 332 | // (5) |
326 | strcpy(card->driver, CARD_NAME_SHORT); | ||
327 | strcpy(card->shortname, CARD_NAME_SHORT); | ||
328 | sprintf(card->longname, "%s at 0x%lx irq %i", | ||
329 | card->shortname, chip->io, chip->irq); | ||
330 | |||
331 | if ((err = pci_read_config_word(pci, PCI_DEVICE_ID, | 333 | if ((err = pci_read_config_word(pci, PCI_DEVICE_ID, |
332 | &(chip->device))) < 0) { | 334 | &(chip->device))) < 0) { |
333 | snd_card_free(card); | 335 | snd_card_free(card); |
diff --git a/sound/pci/au88x0/au88x0_mpu401.c b/sound/pci/au88x0/au88x0_mpu401.c index 873f486b07b8..814bc2db9f0c 100644 --- a/sound/pci/au88x0/au88x0_mpu401.c +++ b/sound/pci/au88x0/au88x0_mpu401.c | |||
@@ -107,6 +107,9 @@ static int __devinit snd_vortex_midi(vortex_t * vortex) | |||
107 | mpu = rmidi->private_data; | 107 | mpu = rmidi->private_data; |
108 | mpu->cport = (unsigned long)(vortex->mmio + VORTEX_MIDI_CMD); | 108 | mpu->cport = (unsigned long)(vortex->mmio + VORTEX_MIDI_CMD); |
109 | #endif | 109 | #endif |
110 | /* Overwrite MIDI name */ | ||
111 | snprintf(rmidi->name, sizeof(rmidi->name), "%s MIDI %d", CARD_NAME_SHORT , vortex->card->number); | ||
112 | |||
110 | vortex->rmidi = rmidi; | 113 | vortex->rmidi = rmidi; |
111 | return 0; | 114 | return 0; |
112 | } | 115 | } |