Skip to content

Commit ad24094

Browse files
committed
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: Takashi Iwai <tiwai@suse.de>
1 parent cf6f1ff commit ad24094

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sound/pci/hda/patch_via.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,10 +832,13 @@ static int via_hp_build(struct hda_codec *codec)
832832
knew->subdevice = HDA_SUBDEV_NID_FLAG | nid;
833833
knew->private_value = nid;
834834

835-
knew = via_clone_control(spec, &via_hp_mixer[1]);
836-
if (knew == NULL)
837-
return -ENOMEM;
838-
knew->subdevice = side_mute_channel(spec);
835+
nid = side_mute_channel(spec);
836+
if (nid) {
837+
knew = via_clone_control(spec, &via_hp_mixer[1]);
838+
if (knew == NULL)
839+
return -ENOMEM;
840+
knew->subdevice = nid;
841+
}
839842

840843
return 0;
841844
}

0 commit comments

Comments
 (0)