Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad240941 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda - Fix no NID error with VIA codecs



The via driver spews warnigs like
	hda-codec: no NID for mapping control Independent HP:0:0
with some codecs because snd_hda_add_nid() is called with nid=0.
This patch fixes it by skipping the call when no corresponding widget
is found.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent cf6f1ff1
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -832,10 +832,13 @@ static int via_hp_build(struct hda_codec *codec)
	knew->subdevice = HDA_SUBDEV_NID_FLAG | nid;
	knew->private_value = nid;

	nid = side_mute_channel(spec);
	if (nid) {
		knew = via_clone_control(spec, &via_hp_mixer[1]);
		if (knew == NULL)
			return -ENOMEM;
	knew->subdevice = side_mute_channel(spec);
		knew->subdevice = nid;
	}

	return 0;
}