patch-2.3.41 linux/drivers/scsi/a2091.c

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

diff -u --recursive --new-file v2.3.40/linux/drivers/scsi/a2091.c linux/drivers/scsi/a2091.c
@@ -188,9 +188,8 @@
 {
     static unsigned char called = 0;
     struct Scsi_Host *instance;
-    caddr_t address;
-    unsigned int key;
-    const struct ConfigDev *cd;
+    unsigned long address;
+    struct zorro_dev *z = NULL;
 
     if (!MACH_IS_AMIGA || called)
 	return 0;
@@ -199,14 +198,19 @@
     tpnt->proc_name = "A2091";
     tpnt->proc_info = &wd33c93_proc_info;
 
-    while ((key = zorro_find(ZORRO_PROD_CBM_A590_A2091_1, 0, 0)) ||
-	   (key = zorro_find(ZORRO_PROD_CBM_A590_A2091_2, 0, 0))) {
-	cd = zorro_get_board(key);
-	address = cd->cd_BoardAddr;
+    while ((z = zorro_find_device(ZORRO_WILDCARD, z))) {
+	if (z->id != ZORRO_PROD_CBM_A590_A2091_1 &&
+	    z->id != ZORRO_PROD_CBM_A590_A2091_2)
+	    continue;
+	address = z->resource.start;
+	if (!request_mem_region(address, 256, "wd33c93"))
+	    continue;
+	strcpy(z->name, "A590/A2091 SCSI Host Adapter");
+
 	instance = scsi_register (tpnt, sizeof (struct WD33C93_hostdata));
-	instance->base = (unsigned char *)ZTWO_VADDR(address);
+	instance->base = ZTWO_VADDR(address);
 	instance->irq = IRQ_AMIGA_PORTS;
-	instance->unique_id = key;
+	instance->unique_id = z->slotaddr;
 	DMA(instance)->DAWR = DAWR_A2091;
 	wd33c93_init(instance, (wd33c93_regs *)&(DMA(instance)->SASR),
 		     dma_setup, dma_stop, WD33C93_FS_8_10);
@@ -217,7 +221,6 @@
 			a2091_intr);
 	}
 	DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN;
-	zorro_config_board(key, 0);
     }
 
     return num_a2091;
@@ -239,7 +242,7 @@
 {
 #ifdef MODULE
 	DMA(instance)->CNTR = 0;
-	zorro_unconfig_board(instance->unique_id, 0);
+	release_mem_region(ZTWO_PADDR(instance->base), 256);
 	if (--num_a2091 == 0)
 		free_irq(IRQ_AMIGA_PORTS, a2091_intr);
 	wd33c93_release();

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