patch-2.4.2 linux/drivers/acorn/scsi/arxescsi.c

Next file: linux/drivers/acorn/scsi/cumana_1.c
Previous file: linux/drivers/acorn/scsi/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.1/linux/drivers/acorn/scsi/arxescsi.c linux/drivers/acorn/scsi/arxescsi.c
@@ -16,6 +16,7 @@
  *  01-01-2000	SH	0.1.0   Added *real* pseudo dma writing
  *				(arxescsi_pseudo_dma_write)
  *  02-04-2000	RMK	0.1.1	Updated for new error handling code.
+ *  22-10-2000  SH		Updated for new registering scheme.
  */
 #include <linux/module.h>
 #include <linux/blk.h>
@@ -27,6 +28,7 @@
 #include <linux/unistd.h>
 #include <linux/stat.h>
 #include <linux/delay.h>
+#include <linux/init.h>
 
 #include <asm/dma.h>
 #include <asm/io.h>
@@ -416,8 +418,24 @@
 	return pos;
 }
 
-#ifdef MODULE
-Scsi_Host_Template driver_template = ARXEScsi;
+static Scsi_Host_Template arxescsi_template = ARXEScsi;
+
+static int __init init_arxe_scsi_driver(void)
+{
+        arxescsi_template.module = THIS_MODULE;
+	scsi_register_module(MODULE_SCSI_HA, &arxescsi_template);
+	if (arxescsi_template.present)
+		return 0;
+
+	scsi_unregister_module(MODULE_SCSI_HA, &arxescsi_template);
+	return -ENODEV;
+}
+
+static void __exit exit_arxe_scsi_driver(void)
+{
+	scsi_unregister_module(MODULE_SCSI_HA, &arxescsi_template);
+}
+
+module_init(init_arxe_scsi_driver);
+module_exit(exit_arxe_scsi_driver);
 
-#include "../../scsi/scsi_module.c"
-#endif

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