diff options
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r-- | sound/pci/hda/hda_generic.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 1d5797a96682..b36f6c5a92df 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -121,11 +121,17 @@ static int add_new_node(struct hda_codec *codec, struct hda_gspec *spec, hda_nid | |||
121 | if (node == NULL) | 121 | if (node == NULL) |
122 | return -ENOMEM; | 122 | return -ENOMEM; |
123 | node->nid = nid; | 123 | node->nid = nid; |
124 | nconns = snd_hda_get_connections(codec, nid, conn_list, | 124 | node->wid_caps = get_wcaps(codec, nid); |
125 | HDA_MAX_CONNECTIONS); | 125 | node->type = get_wcaps_type(node->wid_caps); |
126 | if (nconns < 0) { | 126 | if (node->wid_caps & AC_WCAP_CONN_LIST) { |
127 | kfree(node); | 127 | nconns = snd_hda_get_connections(codec, nid, conn_list, |
128 | return nconns; | 128 | HDA_MAX_CONNECTIONS); |
129 | if (nconns < 0) { | ||
130 | kfree(node); | ||
131 | return nconns; | ||
132 | } | ||
133 | } else { | ||
134 | nconns = 0; | ||
129 | } | 135 | } |
130 | if (nconns <= ARRAY_SIZE(node->slist)) | 136 | if (nconns <= ARRAY_SIZE(node->slist)) |
131 | node->conn_list = node->slist; | 137 | node->conn_list = node->slist; |
@@ -140,8 +146,6 @@ static int add_new_node(struct hda_codec *codec, struct hda_gspec *spec, hda_nid | |||
140 | } | 146 | } |
141 | memcpy(node->conn_list, conn_list, nconns * sizeof(hda_nid_t)); | 147 | memcpy(node->conn_list, conn_list, nconns * sizeof(hda_nid_t)); |
142 | node->nconns = nconns; | 148 | node->nconns = nconns; |
143 | node->wid_caps = get_wcaps(codec, nid); | ||
144 | node->type = (node->wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; | ||
145 | 149 | ||
146 | if (node->type == AC_WID_PIN) { | 150 | if (node->type == AC_WID_PIN) { |
147 | node->pin_caps = snd_hda_query_pin_caps(codec, node->nid); | 151 | node->pin_caps = snd_hda_query_pin_caps(codec, node->nid); |