Skip to contentSkip to conversation

/drivers/block/ps2esdi.c replaced init_module&cleanup_module with module_init&module_exit

PATCH In review Jon Schindler 1 participant 1 message Mar 5, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/11 /drivers/block/ps2esdi.c replaced init_module&cleanup_module with module_init&module_exit

Replaced init_module and cleanup_module with static functions and module_init/module_exit.

---

drivers/block/ps2esdi.c +10 -4
index 3c796e2..edcd150 100644
@@ -135,7 +135,7 @@ static struct block_device_operations ps2esdi_fops  
 static struct gendisk *ps2esdi_gendisk[2];
 
-/* initialization routine called by ll_rw_blk.c   */
+/* initialization routine used when compiled into kernel   */
 static int __init ps2esdi_init(void)
 {
 
@@ -180,7 +180,10 @@ module_param_array(head, int, NULL, 0);
 module_param_array(sect, int, NULL, 0);
 MODULE_LICENSE("GPL");
 
-int init_module(void) {
+/* extra work needs to be done in addition to ps2esdi_init
+ * when compiled as a module */
+static int __init ps2esdi_init_module(void)
+{
 	int drive;
 
 	for(drive = 0; drive < MAX_HD; drive++) {
@@ -198,9 +201,10 @@ int init_module(void) {
 	}
 	return ps2esdi_init();
 }
+module_init(ps2esdi_init_module);
 
-void
-cleanup_module(void) {
+static void __exit ps2esdi_cleanup_module(void)
+{
 	int i;
 	if(ps2esdi_slot) {
 		mca_mark_as_unused(ps2esdi_slot);
@@ -216,6 +220,8 @@ cleanup_module(void) {
 		put_disk(ps2esdi_gendisk[i]);
 	}
 }
+module_exit(ps2esdi_cleanup_module);
+
 #endif /* MODULE */
 
 /* handles boot time command line parameters */