Re: [patch] snd: fix build bug with CONFIG_SND_HDA_CODEC_SIGMATEL=y && !CONFIG_SND_HDA_GENERIC

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>, Jaroslav Kysela <perex@...>, Andrew Morton <akpm@...>
Date: Thursday, October 18, 2007 - 10:18 am

At Thu, 18 Oct 2007 16:54:58 +0200,
Ingo Molnar wrote:

Fair enough.  The revised patch is below.  This cleans up the ifdefs
in another place, too.


Takashi

diff -r fb9512ce24e0 pci/hda/hda_codec.c
--- a/pci/hda/hda_codec.c	Thu Oct 18 10:48:43 2007 +0200
+++ b/pci/hda/hda_codec.c	Thu Oct 18 17:06:44 2007 +0200
@@ -626,24 +626,19 @@ int __devinit snd_hda_codec_new(struct h
 		snd_hda_get_codec_name(codec, bus->card->mixername,
 				       sizeof(bus->card->mixername));
 
-#ifdef CONFIG_SND_HDA_GENERIC
 	if (is_generic_config(codec)) {
 		err = snd_hda_parse_generic_codec(codec);
 		goto patched;
 	}
-#endif
 	if (codec->preset && codec->preset->patch) {
 		err = codec->preset->patch(codec);
 		goto patched;
 	}
 
 	/* call the default parser */
-#ifdef CONFIG_SND_HDA_GENERIC
 	err = snd_hda_parse_generic_codec(codec);
-#else
-	printk(KERN_ERR "hda-codec: No codec parser is available\n");
-	err = -ENODEV;
-#endif
+	if (err < 0)
+		printk(KERN_ERR "hda-codec: No codec parser is available\n");
 
  patched:
 	if (err < 0) {
diff -r fb9512ce24e0 pci/hda/hda_local.h
--- a/pci/hda/hda_local.h	Thu Oct 18 10:48:43 2007 +0200
+++ b/pci/hda/hda_local.h	Thu Oct 18 17:06:44 2007 +0200
@@ -245,7 +245,14 @@ int snd_hda_multi_out_analog_cleanup(str
 /*
  * generic codec parser
  */
+#ifdef CONFIG_SND_HDA_GENERIC
 int snd_hda_parse_generic_codec(struct hda_codec *codec);
+#else
+static int snd_hda_parse_generic_codec(struct hda_codec *codec)
+{
+	return -ENODEV;
+}
+#endif
 
 /*
  * generic proc interface
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [patch] snd: fix build bug with CONFIG_SND_HDA_CODEC_SIG..., Takashi Iwai, (Thu Oct 18, 10:18 am)