aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-01-22 09:35:37 -0500
committerJaroslav Kysela <perex@perex.cz>2008-01-31 11:30:10 -0500
commit0ef6ce7b6acddc3dc9e898125b3bada98a21130a (patch)
treeeb9c73b2d87d9658d71b7cdeb6865e7454f6ee14
parentca7cfae9eb91c012ac448dc6816ded6285f6f39a (diff)
[ALSA] hda-codec - Optimize snd_hda_pser_pin_def_config()
Don't read the widget list again as we already have it at the beginning. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--sound/pci/hda/hda_codec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index d4fd94805e7f..f6a9a5dd9b74 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2671,8 +2671,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
2671 struct auto_pin_cfg *cfg, 2671 struct auto_pin_cfg *cfg,
2672 hda_nid_t *ignore_nids) 2672 hda_nid_t *ignore_nids)
2673{ 2673{
2674 hda_nid_t nid, nid_start; 2674 hda_nid_t nid, end_nid;
2675 int nodes;
2676 short seq, assoc_line_out, assoc_speaker; 2675 short seq, assoc_line_out, assoc_speaker;
2677 short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)]; 2676 short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)];
2678 short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)]; 2677 short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)];
@@ -2685,8 +2684,8 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
2685 memset(sequences_hp, 0, sizeof(sequences_hp)); 2684 memset(sequences_hp, 0, sizeof(sequences_hp));
2686 assoc_line_out = assoc_speaker = 0; 2685 assoc_line_out = assoc_speaker = 0;
2687 2686
2688 nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid_start); 2687 end_nid = codec->start_nid + codec->num_nodes;
2689 for (nid = nid_start; nid < nodes + nid_start; nid++) { 2688 for (nid = codec->start_nid; nid < end_nid; nid++) {
2690 unsigned int wid_caps = get_wcaps(codec, nid); 2689 unsigned int wid_caps = get_wcaps(codec, nid);
2691 unsigned int wid_type = 2690 unsigned int wid_type =
2692 (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; 2691 (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;