Skip to content

Commit

Permalink
[ALSA] hda-codec - Fix build without CONFIG_SND_HDA_GENERIC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tiwai authored and perexg committed Oct 23, 2007
1 parent c8229c3 commit 35a1e0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 2 additions & 7 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 35a1e0c

Please sign in to comment.