patch-2.3.50 linux/drivers/sound/softoss.c

Next file: linux/drivers/sound/sound_calls.h
Previous file: linux/drivers/sound/sgalaxy.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.49/linux/drivers/sound/softoss.c linux/drivers/sound/softoss.c
@@ -11,9 +11,12 @@
  * for more info.
  *
  *
- * Thomas Sailer   : ioctl code reworked (vmalloc/vfree removed)
+ * Thomas Sailer	: ioctl code reworked (vmalloc/vfree removed)
+ * Christoph Hellwig	: adapted to module_init/module_exit
  */
+
 #include <linux/config.h>
+#include <linux/init.h>
 #include <linux/module.h>
 
 /*
@@ -1445,7 +1448,7 @@
 	soft_tmr_restart
 };
 
-int probe_softsyn(struct address_info *hw_config)
+static int __init probe_softsyn(struct address_info *hw_config)
 {
 	int i;
 
@@ -1484,7 +1487,7 @@
 	return 1;
 }
 
-void attach_softsyn_card(struct address_info *hw_config)
+static void __init attach_softsyn_card(struct address_info *hw_config)
 {
 	voice_alloc = &softsyn_operations.alloc;
 	synth_devs[devc->synthdev = num_synths++] = &softsyn_operations;
@@ -1497,7 +1500,7 @@
 #endif
 }
 
-void unload_softsyn(struct address_info *hw_config)
+static void __exit unload_softsyn(struct address_info *hw_config)
 {
 	if (!softsynth_loaded)
 		return;
@@ -1506,25 +1509,25 @@
 	reset_samples(devc);
 }
 
-#ifdef MODULE
-
-static struct address_info config;
+static struct address_info cfg;
 
-int init_module(void)
+static int __init init_softoss(void)
 {
 	printk(KERN_INFO "SoftOSS driver Copyright (C) by Hannu Savolainen 1993-1997\n");
-	if (!probe_softsyn(&config))
+	if (!probe_softsyn(&cfg))
 		return -ENODEV;
-	attach_softsyn_card(&config);
+	attach_softsyn_card(&cfg);
 	SOUND_LOCK;
 	return 0;
 }
 
-void cleanup_module(void)
+static void __exit cleanup_softoss(void)
 {
-	unload_softsyn(&config);
+	unload_softsyn(&cfg);
 	sound_unload_synthdev(devc->synthdev);
 	sound_unload_timerdev(devc->timerdev);
 	SOUND_LOCK_END;
 }
-#endif /* MODULE */
+
+module_init(init_softoss);
+module_exit(cleanup_softoss);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)