ALSA: hda-intel: Cleanups for widget connection list handling
This patch adds a check to snd_hda_get_connections() routine for presence of AC_WCAP_CONN_LIST. Also, make sure that negative error codes from noted route are handled on all places as errors. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:

committed by
Takashi Iwai

parent
254da007f9
commit
16a433d8b3
@@ -306,6 +306,12 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
|
||||
if (snd_BUG_ON(!conn_list || max_conns <= 0))
|
||||
return -EINVAL;
|
||||
|
||||
if ((get_wcaps(codec, nid) & AC_WCAP_CONN_LIST) == 0) {
|
||||
snd_printk(KERN_WARNING "hda_codec: "
|
||||
"connection list not available for 0x%x\n", nid);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
parm = snd_hda_param_read(codec, nid, AC_PAR_CONNLIST_LEN);
|
||||
if (parm & AC_CLIST_LONG) {
|
||||
/* long form */
|
||||
|
Reference in New Issue
Block a user