diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-10-04 07:49:32 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-10-07 08:46:34 -0400 |
commit | b150869369adafb7cc0cf65ea500f9f3c4bbf857 (patch) | |
tree | 84ec5cce59978d59cacc5860008a7a7997551f69 /sound | |
parent | 315e3bd717068624ce888f3d045a168acefc6ce8 (diff) |
[ALSA] emu10k1 - Fix handling of ac97_chip=2
EMU10K1/EMU10K2 driver
Fixed the handling of ac97_chip=2 capability type.
The error occurs in snd_ac97_mixer(), not in snd_ac97_bus().
Also, release the unnecessary ac97_bus object in the error path.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/emu10k1/emumixer.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 6994f90bb83a..7cc831ccd0cb 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c | |||
@@ -802,21 +802,22 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu, | |||
802 | .read = snd_emu10k1_ac97_read, | 802 | .read = snd_emu10k1_ac97_read, |
803 | }; | 803 | }; |
804 | 804 | ||
805 | if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0) { | 805 | if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0) |
806 | if (emu->card_capabilities->ac97_chip == 1) | 806 | return err; |
807 | return err; | ||
808 | snd_printd(KERN_INFO "emu10k1: AC97 is optional on this board\n"); | ||
809 | snd_printd(KERN_INFO" Proceeding without ac97 mixers...\n"); | ||
810 | goto no_ac97; /* FIXME: get rid of ugly gotos.. */ | ||
811 | } | ||
812 | pbus->no_vra = 1; /* we don't need VRA */ | 807 | pbus->no_vra = 1; /* we don't need VRA */ |
813 | 808 | ||
814 | memset(&ac97, 0, sizeof(ac97)); | 809 | memset(&ac97, 0, sizeof(ac97)); |
815 | ac97.private_data = emu; | 810 | ac97.private_data = emu; |
816 | ac97.private_free = snd_emu10k1_mixer_free_ac97; | 811 | ac97.private_free = snd_emu10k1_mixer_free_ac97; |
817 | ac97.scaps = AC97_SCAP_NO_SPDIF; | 812 | ac97.scaps = AC97_SCAP_NO_SPDIF; |
818 | if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) | 813 | if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) { |
819 | return err; | 814 | if (emu->card_capabilities->ac97_chip == 1) |
815 | return err; | ||
816 | snd_printd(KERN_INFO "emu10k1: AC97 is optional on this board\n"); | ||
817 | snd_printd(KERN_INFO" Proceeding without ac97 mixers...\n"); | ||
818 | snd_device_free(emu->card, pbus); | ||
819 | goto no_ac97; /* FIXME: get rid of ugly gotos.. */ | ||
820 | } | ||
820 | if (emu->audigy) { | 821 | if (emu->audigy) { |
821 | /* set master volume to 0 dB */ | 822 | /* set master volume to 0 dB */ |
822 | snd_ac97_write(emu->ac97, AC97_MASTER, 0x0000); | 823 | snd_ac97_write(emu->ac97, AC97_MASTER, 0x0000); |