patch-2.3.20 linux/drivers/char/pms.c

Next file: linux/drivers/char/ppdev.c
Previous file: linux/drivers/char/mem.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.19/linux/drivers/char/pms.c linux/drivers/char/pms.c
@@ -22,6 +22,7 @@
 #include <linux/malloc.h>
 #include <linux/mm.h>
 #include <linux/ioport.h>
+#include <linux/init.h>
 #include <asm/io.h>
 #include <linux/sched.h>
 #include <linux/videodev.h>
@@ -1024,21 +1025,11 @@
 	return 0;
 }
 
-static void shutdown_mediavision(void)
-{
-	release_region(io_port,3);
-	release_region(0x9A01, 1);
-}
-
 /*
- *	Module stuff
+ *	Initialization and module stuff
  */
  
-#ifdef MODULE
-int init_module(void)
-#else
-int init_pms_cards(struct video_init *v)
-#endif
+static int __init init_pms_cards(void)
 {
 	printk(KERN_INFO "Mediavision Pro Movie Studio driver 0.02\n");
 	
@@ -1057,15 +1048,21 @@
 	return video_register_device((struct video_device *)&pms_device, VFL_TYPE_GRABBER);
 }
 
-#ifdef MODULE
-
 MODULE_PARM(io_port,"i");
 MODULE_PARM(mem_base,"i");
 
-void cleanup_module(void)
+static void __exit shutdown_mediavision(void)
+{
+	release_region(io_port,3);
+	release_region(0x9A01, 1);
+}
+
+static void __exit cleanup_pms_module(void)
 {
 	shutdown_mediavision();
 	video_unregister_device((struct video_device *)&pms_device);
 }
 
-#endif
+module_init(init_pms_cards);
+module_exit(cleanup_pms_module);
+

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