patch-2.3.32 linux/drivers/cdrom/mcd.c

Next file: linux/drivers/cdrom/mcdx.c
Previous file: linux/drivers/cdrom/isp16.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.31/linux/drivers/cdrom/mcd.c linux/drivers/cdrom/mcd.c
@@ -68,6 +68,13 @@
 
 	November 1997 -- ported to the Uniform CD-ROM driver by Erik Andersen.
 	March    1999 -- made io base and irq CONFIG_ options (Tigran Aivazian).
+	
+	November 1999 -- Make kernel-parameter implementation work with 2.3.x 
+	                 Removed init_module & cleanup_module in favor of 
+			 module_init & module_exit.
+			 Torben Mathiasen <tmm@image.dk>
+		
+			 
 */
 
 #include <linux/module.h>
@@ -229,9 +236,13 @@
   "mcd",                         /* name of the device type */
 };
 
-
-void __init mcd_setup(char *str, int *ints)
+#ifndef MODULE
+static int __init mcd_setup(char *str)
 {
+   int ints[9];
+   
+   (void)get_options(str, ARRAY_SIZE(ints), ints);
+   
    if (ints[0] > 0)
       mcd_port = ints[1];
    if (ints[0] > 1)      
@@ -240,8 +251,13 @@
    if (ints[0] > 2)
       mitsumi_bug_93_wait = ints[3];
 #endif /* WORK_AROUND_MITSUMI_BUG_93 */
+
+ return 1;
 }
 
+__setup("mcd=", mcd_setup);
+
+#endif /* MODULE */ 
 
 static int mcd_media_changed(struct cdrom_device_info * cdi, int disc_nr)
 {
@@ -648,7 +664,7 @@
 
 
 static void
-do_mcd_request(void)
+do_mcd_request(request_queue_t * q)
 {
 #ifdef TEST2
   printk(" do_mcd_request(%ld+%ld)\n", CURRENT -> sector, CURRENT -> nr_sectors);
@@ -1127,7 +1143,7 @@
 
 
 /* This routine gets called during initialization if things go wrong,
- * and is used in cleanup_module as well. */
+ * and is used in mcd_exit as well. */
 static void cleanup(int level)
 {
   switch (level) {
@@ -1179,7 +1195,7 @@
 	}
 
 	blksize_size[MAJOR_NR] = mcd_blocksizes;
-	blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
 	read_ahead[MAJOR_NR] = 4;
 
 	/* check for card */
@@ -1635,14 +1651,15 @@
 	return limit > 0 ? 0 : -1;
 }
 
-#ifdef MODULE
-int init_module(void)
-{
-	return mcd_init();
-}
 
-void cleanup_module(void)
+void __exit mcd_exit(void)
 {
   cleanup(3);
 }
-#endif MODULE
+
+#ifdef MODULE
+module_init(mcd_init);
+#endif 
+module_exit(mcd_exit);
+
+

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