Skip to content

Commit

Permalink
ALSA: hda - Avoid duplicated path creations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai committed Jan 12, 2013
1 parent e1284af commit 1e0b528
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 1e0b528

Please sign in to comment.