diff options
author | Jaroslav Kysela <perex@perex.cz> | 2009-07-22 10:20:40 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-07-22 10:30:03 -0400 |
commit | 16a433d8b38720a816736d59a62e705c19e31600 (patch) | |
tree | ec2efc9b071b2fc7b68d9a0278a9f64d997d7af1 /sound/pci/hda/hda_codec.c | |
parent | 254da007f93f79ee773788cbb38f24dfab9590f5 (diff) |
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>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 3ecb45ddadf7..aa5540786111 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -306,6 +306,12 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, | |||
306 | if (snd_BUG_ON(!conn_list || max_conns <= 0)) | 306 | if (snd_BUG_ON(!conn_list || max_conns <= 0)) |
307 | return -EINVAL; | 307 | return -EINVAL; |
308 | 308 | ||
309 | if ((get_wcaps(codec, nid) & AC_WCAP_CONN_LIST) == 0) { | ||
310 | snd_printk(KERN_WARNING "hda_codec: " | ||
311 | "connection list not available for 0x%x\n", nid); | ||
312 | return -EINVAL; | ||
313 | } | ||
314 | |||
309 | parm = snd_hda_param_read(codec, nid, AC_PAR_CONNLIST_LEN); | 315 | parm = snd_hda_param_read(codec, nid, AC_PAR_CONNLIST_LEN); |
310 | if (parm & AC_CLIST_LONG) { | 316 | if (parm & AC_CLIST_LONG) { |
311 | /* long form */ | 317 | /* long form */ |