Commit 35a1e0cce647737b88dac7ca526fc525d92b3fff
Committed by
Jaroslav Kysela
1 parent
c8229c38c6
Exists in
master
and in
7 other branches
[ALSA] hda-codec - Fix build without CONFIG_SND_HDA_GENERIC
Fixed the build error from patch_sigmatel.c when built without CONFIG_SND_HDA_GENERIC by defining a dummy function to return error. Also, clean up hda_codec.c by removing unneeded ifdefs (the compiler will optimize out). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Showing 2 changed files with 9 additions and 7 deletions Side-by-side Diff
sound/pci/hda/hda_codec.c
... | ... | @@ -626,24 +626,19 @@ |
626 | 626 | snd_hda_get_codec_name(codec, bus->card->mixername, |
627 | 627 | sizeof(bus->card->mixername)); |
628 | 628 | |
629 | -#ifdef CONFIG_SND_HDA_GENERIC | |
630 | 629 | if (is_generic_config(codec)) { |
631 | 630 | err = snd_hda_parse_generic_codec(codec); |
632 | 631 | goto patched; |
633 | 632 | } |
634 | -#endif | |
635 | 633 | if (codec->preset && codec->preset->patch) { |
636 | 634 | err = codec->preset->patch(codec); |
637 | 635 | goto patched; |
638 | 636 | } |
639 | 637 | |
640 | 638 | /* call the default parser */ |
641 | -#ifdef CONFIG_SND_HDA_GENERIC | |
642 | 639 | err = snd_hda_parse_generic_codec(codec); |
643 | -#else | |
644 | - printk(KERN_ERR "hda-codec: No codec parser is available\n"); | |
645 | - err = -ENODEV; | |
646 | -#endif | |
640 | + if (err < 0) | |
641 | + printk(KERN_ERR "hda-codec: No codec parser is available\n"); | |
647 | 642 | |
648 | 643 | patched: |
649 | 644 | if (err < 0) { |
sound/pci/hda/hda_local.h
... | ... | @@ -245,7 +245,14 @@ |
245 | 245 | /* |
246 | 246 | * generic codec parser |
247 | 247 | */ |
248 | +#ifdef CONFIG_SND_HDA_GENERIC | |
248 | 249 | int snd_hda_parse_generic_codec(struct hda_codec *codec); |
250 | +#else | |
251 | +static inline int snd_hda_parse_generic_codec(struct hda_codec *codec) | |
252 | +{ | |
253 | + return -ENODEV; | |
254 | +} | |
255 | +#endif | |
249 | 256 | |
250 | 257 | /* |
251 | 258 | * generic proc interface |