summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-23 13:57:20 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-23 13:57:20 +0100
commit0db75790e282dd1c8752b2472a9485940dd92c70 (patch)
tree9bed56a8ea26e9819b4ceaf10d01713598e214ab /sound/pci/hda/patch_realtek.c
parent2cf215bfaa01384374291a118c8152ab18a55a63 (diff)
downloadop-kernel-dev-0db75790e282dd1c8752b2472a9485940dd92c70.zip
op-kernel-dev-0db75790e282dd1c8752b2472a9485940dd92c70.tar.gz
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>
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 604fe5e..515f83b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2729,12 +2729,13 @@ static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
{
struct alc_spec *spec = codec->spec;
- if (snd_BUG_ON(!spec->gen.am_entry[1].pin ||
- !spec->gen.autocfg.hp_pins[0]))
- return;
- if (action == HDA_FIXUP_ACT_PROBE)
+ if (action == HDA_FIXUP_ACT_PROBE) {
+ if (snd_BUG_ON(!spec->gen.am_entry[1].pin ||
+ !spec->gen.autocfg.hp_pins[0]))
+ return;
snd_hda_jack_set_gating_jack(codec, spec->gen.am_entry[1].pin,
spec->gen.autocfg.hp_pins[0]);
+ }
}
enum {
OpenPOWER on IntegriCloud