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

Next file: linux/drivers/cdrom/optcd.c
Previous file: linux/drivers/cdrom/mcd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.31/linux/drivers/cdrom/mcdx.c linux/drivers/cdrom/mcdx.c
@@ -44,6 +44,10 @@
  *  Marcin Dalecki (improved performance, shortened code)
  *  ... somebody forgotten?
  *
+ *  9 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>
  */
 
 
@@ -208,10 +212,8 @@
 
 /* declared in blk.h */
 int mcdx_init(void);
-void do_mcdx_request(void);
+void do_mcdx_request(request_queue_t * q);
 
-/* already declared in init/main */
-void mcdx_setup(char *, int *);
 
 /*	Indirect exported functions. These functions are exported by their
 	addresses, such as mcdx_open and mcdx_close in the
@@ -521,7 +523,7 @@
 	}
 }
 
-void do_mcdx_request()
+void do_mcdx_request(request_queue_t * q)
 {
     int dev;
     struct s_drive_stuff *stuffp;
@@ -770,12 +772,21 @@
 	return 1;
 }
 
-void __init mcdx_setup(char *str, int *pi)
+#ifndef MODULE
+static int __init mcdx_setup(char *str)
 {
+	int pi[4];
+	(void)get_options(str, ARRAY_SIZE(pi), pi);
+	
 	if (pi[0] > 0) mcdx_drive_map[0][0] = pi[1];
 	if (pi[0] > 1) mcdx_drive_map[0][1] = pi[2];
+	return 1;
 }
 
+__setup("mcdx=", mcdx_setup);
+
+#endif
+
 /* DIRTY PART ******************************************************/
 
 static void mcdx_delay(struct s_drive_stuff *stuff, long jifs)
@@ -953,10 +964,10 @@
 }
 
 /* MODULE STUFF ***********************************************************/
-#ifdef MODULE
+
 EXPORT_NO_SYMBOLS;
 
-int init_module(void)
+int __mcdx_init(void)
 {
 	int i;
 	int drives = 0;
@@ -976,7 +987,7 @@
     return 0;
 }
 
-void cleanup_module(void)
+void __exit mcdx_exit(void)
 {
     int i;
 
@@ -1009,7 +1020,11 @@
 #endif
 }
 
-#endif MODULE
+#ifdef MODULE
+module_init(__mcdx_init);
+#endif
+module_exit(mcdx_exit);
+
 
 /* Support functions ************************************************/
 
@@ -1116,7 +1131,7 @@
 		return 1;
 	}
 
-	blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;
+	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
 	read_ahead[MAJOR_NR] = READ_AHEAD;
 	blksize_size[MAJOR_NR] = mcdx_blocksizes;
 

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