diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 625fe5984dd6..e16cf63821ae 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -709,7 +709,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) | |||
709 | * Returns 0 if successful, or a negative error code. | 709 | * Returns 0 if successful, or a negative error code. |
710 | */ | 710 | */ |
711 | int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, | 711 | int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, |
712 | struct hda_codec **codecp) | 712 | int do_init, struct hda_codec **codecp) |
713 | { | 713 | { |
714 | struct hda_codec *codec; | 714 | struct hda_codec *codec; |
715 | char component[31]; | 715 | char component[31]; |
@@ -793,10 +793,12 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr | |||
793 | if (bus->modelname) | 793 | if (bus->modelname) |
794 | codec->modelname = kstrdup(bus->modelname, GFP_KERNEL); | 794 | codec->modelname = kstrdup(bus->modelname, GFP_KERNEL); |
795 | 795 | ||
796 | err = snd_hda_codec_configure(codec); | 796 | if (do_init) { |
797 | if (err < 0) { | 797 | err = snd_hda_codec_configure(codec); |
798 | snd_hda_codec_free(codec); | 798 | if (err < 0) { |
799 | return err; | 799 | snd_hda_codec_free(codec); |
800 | return err; | ||
801 | } | ||
800 | } | 802 | } |
801 | snd_hda_codec_proc_new(codec); | 803 | snd_hda_codec_proc_new(codec); |
802 | 804 | ||