mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-14 09:47:20 +00:00
[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>
This commit is contained in:
parent
a59524faf3
commit
520290e43f
@ -261,6 +261,13 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
snd_vortex_workaround(pci, pcifix[dev]);
|
snd_vortex_workaround(pci, pcifix[dev]);
|
||||||
|
|
||||||
|
// Card details needed in snd_vortex_midi
|
||||||
|
strcpy(card->driver, CARD_NAME_SHORT);
|
||||||
|
sprintf(card->shortname, "Aureal Vortex %s", CARD_NAME_SHORT);
|
||||||
|
sprintf(card->longname, "%s at 0x%lx irq %i",
|
||||||
|
card->shortname, chip->io, chip->irq);
|
||||||
|
|
||||||
// (4) Alloc components.
|
// (4) Alloc components.
|
||||||
// ADB pcm.
|
// ADB pcm.
|
||||||
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {
|
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)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// (5)
|
// (5)
|
||||||
strcpy(card->driver, CARD_NAME_SHORT);
|
|
||||||
strcpy(card->shortname, CARD_NAME_SHORT);
|
|
||||||
sprintf(card->longname, "%s at 0x%lx irq %i",
|
|
||||||
card->shortname, chip->io, chip->irq);
|
|
||||||
|
|
||||||
if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
|
if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
|
||||||
&(chip->device))) < 0) {
|
&(chip->device))) < 0) {
|
||||||
snd_card_free(card);
|
snd_card_free(card);
|
||||||
|
@ -107,6 +107,9 @@ static int __devinit snd_vortex_midi(vortex_t * vortex)
|
|||||||
mpu = rmidi->private_data;
|
mpu = rmidi->private_data;
|
||||||
mpu->cport = (unsigned long)(vortex->mmio + VORTEX_MIDI_CMD);
|
mpu->cport = (unsigned long)(vortex->mmio + VORTEX_MIDI_CMD);
|
||||||
#endif
|
#endif
|
||||||
|
/* Overwrite MIDI name */
|
||||||
|
snprintf(rmidi->name, sizeof(rmidi->name), "%s MIDI %d", CARD_NAME_SHORT , vortex->card->number);
|
||||||
|
|
||||||
vortex->rmidi = rmidi;
|
vortex->rmidi = rmidi;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user