summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-04 12:56:52 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-12 08:43:30 +0100
commit1e0b528696edf20ad38f494dda49c6195bee1b7f (patch)
tree34ff0e122d229a9c1cab80ba4957b2a394caf55b
parente1284af730792344f96e1428a6199e19699dfccc (diff)
ALSA: hda - Avoid duplicated path creations
When the paths are created in map_singles(), we don't have to re-create new paths in try_assign_dacs(). Just evaluate the badness and skip to the next item. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_generic.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 3507448c8b0d..ee2c973f9125 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -833,8 +833,13 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs,
for (i = 0; i < num_outs; i++) {
struct nid_path *path;
hda_nid_t pin = pins[i];
- if (!dacs[i])
- dacs[i] = look_for_dac(codec, pin, false);
+
+ if (dacs[i]) {
+ badness += assign_out_path_ctls(codec, pin, dacs[i]);
+ continue;
+ }
+
+ dacs[i] = look_for_dac(codec, pin, false);
if (!dacs[i] && !i) {
for (j = 1; j < num_outs; j++) {
if (is_reachable_path(codec, dacs[j], pin)) {