sound: hda: Fix compilation error
Preetham Chandru R [Fri, 2 Aug 2013 10:33:54 +0000 (15:33 +0530)]
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>

sound/pci/hda/hda_intel.c

index ae1937a..a54fb8e 100644 (file)
@@ -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)