diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-06-17 03:33:52 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-06-24 05:52:59 -0400 |
commit | a1e21c9078fb8005e5accb921696ec9e2f38176e (patch) | |
tree | 53b6495d7d60354688031b28aa331d7e58286d6e /sound/pci/hda/hda_codec.c | |
parent | 8c8145b8734028f6deb487f7d64748da4c6c39ac (diff) |
ALSA: hda - Don't call snd_hda_codec_configure in snd_hda_codec_new()
The codec setup call via snd_hda_codec_configure() isn't necessarily
called in snd_hda_codec_new(). For the later added feature, it's better
to change the code flow like:
- create all codec instances
- configure each codec
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 462e2cedaa6a..506f46ef0304 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -885,7 +885,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, | |||
885 | * Returns 0 if successful, or a negative error code. | 885 | * Returns 0 if successful, or a negative error code. |
886 | */ | 886 | */ |
887 | int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, | 887 | int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, |
888 | int do_init, struct hda_codec **codecp) | 888 | struct hda_codec **codecp) |
889 | { | 889 | { |
890 | struct hda_codec *codec; | 890 | struct hda_codec *codec; |
891 | char component[31]; | 891 | char component[31]; |
@@ -978,11 +978,6 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr | |||
978 | codec->afg ? codec->afg : codec->mfg, | 978 | codec->afg ? codec->afg : codec->mfg, |
979 | AC_PWRST_D0); | 979 | AC_PWRST_D0); |
980 | 980 | ||
981 | if (do_init) { | ||
982 | err = snd_hda_codec_configure(codec); | ||
983 | if (err < 0) | ||
984 | goto error; | ||
985 | } | ||
986 | snd_hda_codec_proc_new(codec); | 981 | snd_hda_codec_proc_new(codec); |
987 | 982 | ||
988 | snd_hda_create_hwdep(codec); | 983 | snd_hda_create_hwdep(codec); |
@@ -1036,6 +1031,7 @@ int snd_hda_codec_configure(struct hda_codec *codec) | |||
1036 | err = init_unsol_queue(codec->bus); | 1031 | err = init_unsol_queue(codec->bus); |
1037 | return err; | 1032 | return err; |
1038 | } | 1033 | } |
1034 | EXPORT_SYMBOL_HDA(snd_hda_codec_configure); | ||
1039 | 1035 | ||
1040 | /** | 1036 | /** |
1041 | * snd_hda_codec_setup_stream - set up the codec for streaming | 1037 | * snd_hda_codec_setup_stream - set up the codec for streaming |