lkml.org 
[lkml]   [2005]   [Oct]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 04 Oct 2005 12:50:55 +0200
FromTakashi Iwai <>
SubjectRe: [Alsa-devel] Re: [ALSA] snd-emu10k1: ALSA bug#1297: Fix a error recognising the SB Live Platinum.
At Tue, 04 Oct 2005 08:39:36 +0200,
Peter Zubaj wrote:
> > > If ac97_chip=1 and ac97 doesn't exists - driver will refuse to load.
> If ac97_chip=2 and ac97 doesn't exists - driver should ignore ac97
> > But I don't know if this is correct (I am not author of patch and I not tested it).
> if message is printed then there is> goto no_ac97; /* FIXME: get rid of ugly gotos.. */> this will skip ac97 mixer creation (if ac97 is not there this will fail and driver refuses to load)
> But I don't know if snd_ac97_bus will fail if there is no ac97 codec (I think - not, and this is not correct), then test should be done on snd_ac97_mixer and not on snd_ac97_bus creation.

You're right.  The additional patch below fixes it.


Takashi


--- linux/sound/pci/emu10k1/emumixer.c	29 Sep 2005 17:59:43 -0000	1.38
+++ linux/sound/pci/emu10k1/emumixer.c	4 Oct 2005 10:48:42 -0000
@@ -802,21 +802,21 @@
 			.read = snd_emu10k1_ac97_read,
 		};
 
-		if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0) {
-			if (emu->card_capabilities->ac97_chip == 1)
-				return err;
-			snd_printd(KERN_INFO "emu10k1: AC97 is optional on this board\n");
-			snd_printd(KERN_INFO"          Proceeding without ac97 mixers...\n");
-			goto no_ac97; /* FIXME: get rid of ugly gotos.. */
-		}
+		if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0)
+			return err;
 		pbus->no_vra = 1; /* we don't need VRA */
 		
 		memset(&ac97, 0, sizeof(ac97));
 		ac97.private_data = emu;
 		ac97.private_free = snd_emu10k1_mixer_free_ac97;
 		ac97.scaps = AC97_SCAP_NO_SPDIF;
-		if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0)
-			return err;
+		if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0) {
+			if (emu->card_capabilities->ac97_chip == 1)
+				return err;
+			snd_printd(KERN_INFO "emu10k1: AC97 is optional on this board\n");
+			snd_printd(KERN_INFO"          Proceeding without ac97 mixers...\n");
+			goto no_ac97; /* FIXME: get rid of ugly gotos.. */
+		}
 		if (emu->audigy) {
 			/* set master volume to 0 dB */
 			snd_ac97_write(emu->ac97, AC97_MASTER, 0x0000);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-10-04 10:54    [W:0.207 / U:0.520 seconds]
©2003-2008 Jasper Spaans