diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 187533e477c6e178d2b57cc8575548778448ffb2..ad4cb38109fcc2de06f0891ea737adc91769f2eb 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -626,24 +626,19 @@ int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, 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 --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index a79d0ed5469c297215d37d741f2a569e905148c5..a708effdcdad07f153ac20abfb5d4e4005d6a40c 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -245,7 +245,14 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, /* * generic codec parser */ +#ifdef CONFIG_SND_HDA_GENERIC int snd_hda_parse_generic_codec(struct hda_codec *codec); +#else +static inline int snd_hda_parse_generic_codec(struct hda_codec *codec) +{ + return -ENODEV; +} +#endif /* * generic proc interface