summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-09-13 10:33:16 +0200
committerTakashi Iwai <tiwai@suse.de>2011-09-13 10:33:16 +0200
commit99e14c9d4140e9ed2c8810322a377e2a51b356eb (patch)
treeb4089f76f8a0986def788d2c6ab2652530b65918 /sound
parent26b9b559ed9ff3bef5642ef731748d28d894705f (diff)
downloadlinux-stable-99e14c9d4140e9ed2c8810322a377e2a51b356eb.tar.gz
linux-stable-99e14c9d4140e9ed2c8810322a377e2a51b356eb.tar.bz2
linux-stable-99e14c9d4140e9ed2c8810322a377e2a51b356eb.zip
ALSA: hda - Terminate the recursive connection search properly
The recursive search of widget connections in snd_hda_get_conn_index() must be terminated at the pin and the audio-out widgets. Otherwise you'll get "too deep connection" warnings unnecessarily. Reported-by: Francis Moreau <francis.moro@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_codec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 3e7850c238c3..f3aefef37216 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -579,9 +579,13 @@ int snd_hda_get_conn_index(struct hda_codec *codec, hda_nid_t mux,
return -1;
}
recursive++;
- for (i = 0; i < nums; i++)
+ for (i = 0; i < nums; i++) {
+ unsigned int type = get_wcaps_type(get_wcaps(codec, conn[i]));
+ if (type == AC_WID_PIN || type == AC_WID_AUD_OUT)
+ continue;
if (snd_hda_get_conn_index(codec, conn[i], nid, recursive) >= 0)
return i;
+ }
return -1;
}
EXPORT_SYMBOL_HDA(snd_hda_get_conn_index);