diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-06-17 08:23:46 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-06-17 08:23:46 -0400 |
commit | ad2409413d09fca763be1ac5161f2a9d82367903 (patch) | |
tree | eb882444d86ede68e1bba554e31ce68d58616b81 /sound | |
parent | cf6f1ff17f56c275424c5a341fc4d27ccbbfa71c (diff) |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_via.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 605c99e1e520..c952582fb218 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -832,10 +832,13 @@ static int via_hp_build(struct hda_codec *codec) | |||
832 | knew->subdevice = HDA_SUBDEV_NID_FLAG | nid; | 832 | knew->subdevice = HDA_SUBDEV_NID_FLAG | nid; |
833 | knew->private_value = nid; | 833 | knew->private_value = nid; |
834 | 834 | ||
835 | knew = via_clone_control(spec, &via_hp_mixer[1]); | 835 | nid = side_mute_channel(spec); |
836 | if (knew == NULL) | 836 | if (nid) { |
837 | return -ENOMEM; | 837 | knew = via_clone_control(spec, &via_hp_mixer[1]); |
838 | knew->subdevice = side_mute_channel(spec); | 838 | if (knew == NULL) |
839 | return -ENOMEM; | ||
840 | knew->subdevice = nid; | ||
841 | } | ||
839 | 842 | ||
840 | return 0; | 843 | return 0; |
841 | } | 844 | } |