[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>
This commit is contained in:
Takashi Iwai 2008-01-22 15:35:37 +01:00 committed by Jaroslav Kysela
parent ca7cfae9eb
commit 0ef6ce7b6a

View File

@ -2671,8 +2671,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
struct auto_pin_cfg *cfg, struct auto_pin_cfg *cfg,
hda_nid_t *ignore_nids) hda_nid_t *ignore_nids)
{ {
hda_nid_t nid, nid_start; hda_nid_t nid, end_nid;
int nodes;
short seq, assoc_line_out, assoc_speaker; short seq, assoc_line_out, assoc_speaker;
short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)]; short sequences_line_out[ARRAY_SIZE(cfg->line_out_pins)];
short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)]; short sequences_speaker[ARRAY_SIZE(cfg->speaker_pins)];
@ -2685,8 +2684,8 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
memset(sequences_hp, 0, sizeof(sequences_hp)); memset(sequences_hp, 0, sizeof(sequences_hp));
assoc_line_out = assoc_speaker = 0; assoc_line_out = assoc_speaker = 0;
nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid_start); end_nid = codec->start_nid + codec->num_nodes;
for (nid = nid_start; nid < nodes + nid_start; nid++) { for (nid = codec->start_nid; nid < end_nid; nid++) {
unsigned int wid_caps = get_wcaps(codec, nid); unsigned int wid_caps = get_wcaps(codec, nid);
unsigned int wid_type = unsigned int wid_type =
(wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;