Commit 0bed2aa3 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda - Sanity check of unexpected cap_sync_hook override



There are a couple of places setting cap_sync_hook in the codec
drivers, and they just overwrite the value.  Add a sanity check via
WARN_ON() in case if an old non-NULL value is overridden and
forgotten.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3bf29db7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -343,6 +343,7 @@ static void cxt_fixup_headphone_mic(struct hda_codec *codec,
		snd_hdac_regmap_add_vendor_verb(&codec->core, 0x410);
		break;
	case HDA_FIXUP_ACT_PROBE:
		WARN_ON(spec->gen.cap_sync_hook);
		spec->gen.cap_sync_hook = cxt_update_headset_mode_hook;
		spec->gen.automute_hook = cxt_update_headset_mode;
		break;
+1 −0
Original line number Diff line number Diff line
@@ -4828,6 +4828,7 @@ static void alc_probe_headset_mode(struct hda_codec *codec)
			spec->headphone_mic_pin = cfg->inputs[i].pin;
	}

	WARN_ON(spec->gen.cap_sync_hook);
	spec->gen.cap_sync_hook = alc_update_headset_mode_hook;
	spec->gen.automute_hook = alc_update_headset_mode;
	spec->gen.hp_automute_hook = alc_update_headset_jack_cb;