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

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

diff -u --recursive --new-file v2.3.13/linux/drivers/scsi/a2091.c linux/drivers/scsi/a2091.c
@@ -34,6 +34,7 @@
 
 static void a2091_intr (int irq, void *dummy, struct pt_regs *fp)
 {
+    unsigned long flags;
     unsigned int status;
     struct Scsi_Host *instance;
     for (instance = first_instance; instance &&
@@ -41,32 +42,20 @@
     {
 	status = DMA(instance)->ISTR;
 	if (!(status & (ISTR_INT_F|ISTR_INT_P)))
-	    continue;
+		continue;
 
-	if (status & ISTR_INTS)
-	{
-	    /* disable PORTS interrupt */
-	    custom.intena = IF_PORTS;
-	    wd33c93_intr (instance);
-	    /* enable PORTS interrupt */
-	    custom.intena = IF_SETCLR | IF_PORTS;
+	if (status & ISTR_INTS) {
+		spin_lock_irqsave(&io_request_lock, flags);
+		wd33c93_intr (instance);
+		spin_unlock_irqrestore(&io_request_lock, flags);
 	}
     }
 }
 
-static void do_a2091_intr (int irq, void *dummy, struct pt_regs *fp)
-{
-    unsigned long flags;
-
-    spin_lock_irqsave(&io_request_lock, flags);
-    a2091_intr(irq, dummy, fp);
-    spin_unlock_irqrestore(&io_request_lock, flags);
-}
-
 static int dma_setup (Scsi_Cmnd *cmd, int dir_in)
 {
     unsigned short cntr = CNTR_PDMD | CNTR_INTEN;
-    unsigned long addr = VTOP(cmd->SCp.ptr);
+    unsigned long addr = virt_to_bus(cmd->SCp.ptr);
     struct Scsi_Host *instance = cmd->host;
 
     /* don't allow DMA if the physical address is bad */
@@ -85,7 +74,7 @@
 	}
 
 	/* get the physical address of the bounce buffer */
-	addr = VTOP(HDATA(instance)->dma_bounce_buffer);
+	addr = virt_to_bus(HDATA(instance)->dma_bounce_buffer);
 
 	/* the bounce buffer may not be in the first 16M of physmem */
 	if (addr & A2091_XFER_MASK) {
@@ -200,7 +189,7 @@
 
 static int num_a2091 = 0;
 
-__initfunc(int a2091_detect(Scsi_Host_Template *tpnt))
+int __init a2091_detect(Scsi_Host_Template *tpnt)
 {
     static unsigned char called = 0;
     struct Scsi_Host *instance;
@@ -229,7 +218,8 @@
 	if (num_a2091++ == 0) {
 	    first_instance = instance;
 	    a2091_template = instance->hostt;
-	    request_irq(IRQ_AMIGA_PORTS, do_a2091_intr, 0, "A2091 SCSI", a2091_intr);
+	    request_irq(IRQ_AMIGA_PORTS, a2091_intr, SA_SHORQ, "A2091 SCSI",
+			a2091_intr);
 	}
 	DMA(instance)->CNTR = CNTR_PDMD | CNTR_INTEN;
 	zorro_config_board(key, 0);

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