summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorPreetham Chandru R <pchandru@nvidia.com>2013-08-02 16:03:54 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 13:18:10 -0700
commit71b6e70330b90f0e5084157265399ec5d01d2b33 (patch)
tree609013eddba8671ed01e2eaae30a48251da83969 /sound
parent678a33130dbee27f196e68610e4d9982c690068a (diff)
sound: hda: Fix compilation error
This commit resolves the below error: sound/pci/hda/hda_intel.c:4212:1: error: redefinition of '__inittest' sound/pci/hda/hda_intel.c:4211:1: note: previous definition of '__inittest' was here Bug 1342028 Change-Id: Ic8ae2f408ca82cc11ccc83f0c6c2d1b20051c26e Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Reviewed-on: http://git-master/r/257476 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_intel.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ae1937ace30a..a54fb8e69362 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -4455,5 +4455,36 @@ static struct platform_driver hda_platform_driver = {
};
#endif /* CONFIG_SND_HDA_PLATFORM_DRIVER */
-module_pci_driver(azx_driver);
-module_platform_driver(hda_platform_driver);
+static int __init alsa_card_azx_init(void)
+{
+ int err = 0;
+
+ err = pci_register_driver(&azx_driver);
+ if (err < 0) {
+ snd_printk(KERN_ERR SFX "Failed to register pci driver\n");
+ return err;
+ }
+
+#ifdef CONFIG_SND_HDA_PLATFORM_DRIVER
+ err = platform_driver_register(&hda_platform_driver);
+ if (err < 0) {
+ snd_printk(KERN_ERR SFX "Failed to register platform driver\n");
+ pci_unregister_driver(&azx_driver);
+ return err;
+ }
+#endif
+
+ return 0;
+}
+
+static void __exit alsa_card_azx_exit(void)
+{
+#ifdef CONFIG_SND_HDA_PLATFORM_DRIVER
+ platform_driver_unregister(&hda_platform_driver);
+#endif
+
+ pci_unregister_driver(&azx_driver);
+}
+
+module_init(alsa_card_azx_init)
+module_exit(alsa_card_azx_exit)