Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751215AbVJDKvG (ORCPT ); Tue, 4 Oct 2005 06:51:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751216AbVJDKvG (ORCPT ); Tue, 4 Oct 2005 06:51:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:64689 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S1751215AbVJDKvF (ORCPT ); Tue, 4 Oct 2005 06:51:05 -0400 Date: Tue, 04 Oct 2005 12:50:55 +0200 Message-ID: From: Takashi Iwai To: "Peter Zubaj" Cc: "Dave Jones" , alsa-devel@alsa-project.org, James@superbug.co.uk, "Linux Kernel Mailing List" , perex@suse.cz Subject: Re: [Alsa-devel] Re: [ALSA] snd-emu10k1: ALSA bug#1297: Fix a error recognising the SB Live Platinum. In-Reply-To: References: User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta18) (chestnut) (+CVS-20041021) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2321 Lines: 57 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/