ALSA: hda - Fix invalid snd_BUG_ON() in alc271_hp_gate_mic_jack()

The fixup function is called multiple times before parsing the pins,
so snd_BUG_ON() hits when loaded.  Move it to the proper place in the
if block.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2013-01-23 13:57:20 +01:00
parent 2cf215bfaa
commit 0db75790e2
1 changed files with 5 additions and 4 deletions

View File

@ -2729,13 +2729,14 @@ static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
{ {
struct alc_spec *spec = codec->spec; struct alc_spec *spec = codec->spec;
if (action == HDA_FIXUP_ACT_PROBE) {
if (snd_BUG_ON(!spec->gen.am_entry[1].pin || if (snd_BUG_ON(!spec->gen.am_entry[1].pin ||
!spec->gen.autocfg.hp_pins[0])) !spec->gen.autocfg.hp_pins[0]))
return; return;
if (action == HDA_FIXUP_ACT_PROBE)
snd_hda_jack_set_gating_jack(codec, spec->gen.am_entry[1].pin, snd_hda_jack_set_gating_jack(codec, spec->gen.am_entry[1].pin,
spec->gen.autocfg.hp_pins[0]); spec->gen.autocfg.hp_pins[0]);
} }
}
enum { enum {
ALC269_FIXUP_SONY_VAIO, ALC269_FIXUP_SONY_VAIO,