Commit 1e0b5286 authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent e1284af7
...@@ -833,8 +833,13 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs, ...@@ -833,8 +833,13 @@ static int try_assign_dacs(struct hda_codec *codec, int num_outs,
for (i = 0; i < num_outs; i++) { for (i = 0; i < num_outs; i++) {
struct nid_path *path; struct nid_path *path;
hda_nid_t pin = pins[i]; 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) { if (!dacs[i] && !i) {
for (j = 1; j < num_outs; j++) { for (j = 1; j < num_outs; j++) {
if (is_reachable_path(codec, dacs[j], pin)) { if (is_reachable_path(codec, dacs[j], pin)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment