aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/pci/hda/hda_bind.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_bind.c')
-rw-r--r--sound/pci/hda/hda_bind.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c
index 311896a23cd1..a49bc45c2ea5 100644
--- a/sound/pci/hda/hda_bind.c
+++ b/sound/pci/hda/hda_bind.c
@@ -106,16 +106,28 @@ static int hda_codec_driver_probe(struct device *dev)
}
err = codec->preset->patch(codec);
- if (err < 0) {
- module_put(owner);
- goto error;
+ if (err < 0)
+ goto error_module;
+
+ err = snd_hda_codec_build_pcms(codec);
+ if (err < 0)
+ goto error_module;
+ err = snd_hda_codec_build_controls(codec);
+ if (err < 0)
+ goto error_module;
+ if (codec->card->registered) {
+ err = snd_card_register(codec->card);
+ if (err < 0)
+ goto error_module;
}
return 0;
+ error_module:
+ module_put(owner);
+
error:
- codec->preset = NULL;
- memset(&codec->patch_ops, 0, sizeof(codec->patch_ops));
+ snd_hda_codec_cleanup_for_unbind(codec);
return err;
}