Commit f3f72ed2 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] Amiga GVP-II SCSI fix

GVP-II SCSI: Fix compilation by getting rid of the obsolete SCSI host instance
loop and using per-card interrupt handlers instead.
parent e182590f
...@@ -1451,7 +1451,7 @@ config A2091_SCSI ...@@ -1451,7 +1451,7 @@ config A2091_SCSI
config GVP11_SCSI config GVP11_SCSI
tristate "GVP Series II WD33C93A support" tristate "GVP Series II WD33C93A support"
depends on ZORRO && SCSI && BROKEN depends on ZORRO && SCSI
---help--- ---help---
If you have a Great Valley Products Series II SCSI controller, If you have a Great Valley Products Series II SCSI controller,
answer Y. Also say Y if you have a later model of GVP SCSI answer Y. Also say Y if you have a later model of GVP SCSI
......
...@@ -25,29 +25,20 @@ ...@@ -25,29 +25,20 @@
#define DMA(ptr) ((gvp11_scsiregs *)((ptr)->base)) #define DMA(ptr) ((gvp11_scsiregs *)((ptr)->base))
#define HDATA(ptr) ((struct WD33C93_hostdata *)((ptr)->hostdata)) #define HDATA(ptr) ((struct WD33C93_hostdata *)((ptr)->hostdata))
static struct Scsi_Host *first_instance = NULL; static irqreturn_t gvp11_intr (int irq, void *_instance, struct pt_regs *fp)
static Scsi_Host_Template *gvp11_template;
static irqreturn_t gvp11_intr (int irq, void *dummy, struct pt_regs *fp)
{ {
unsigned long flags; unsigned long flags;
unsigned int status; unsigned int status;
struct Scsi_Host *instance; struct Scsi_Host *instance = (struct Scsi_Host *)_instance;
int handled = 0;
for (instance = first_instance; instance &&
instance->hostt == gvp11_template; instance = instance->next)
{
status = DMA(instance)->CNTR; status = DMA(instance)->CNTR;
if (!(status & GVP11_DMAC_INT_PENDING)) if (!(status & GVP11_DMAC_INT_PENDING))
continue; return IRQ_NONE;
spin_lock_irqsave(instance->host_lock, flags); spin_lock_irqsave(instance->host_lock, flags);
wd33c93_intr (instance); wd33c93_intr(instance);
spin_unlock_irqrestore(instance->host_lock, flags); spin_unlock_irqrestore(instance->host_lock, flags);
handled = 1; return IRQ_HANDLED;
}
return IRQ_RETVAL(handled);
} }
static int gvp11_xfer_mask = 0; static int gvp11_xfer_mask = 0;
...@@ -177,8 +168,6 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt, ...@@ -177,8 +168,6 @@ static void dma_stop (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
} }
} }
static int num_gvp11 = 0;
#define CHECK_WD33C93 #define CHECK_WD33C93
int __init gvp11_detect(Scsi_Host_Template *tpnt) int __init gvp11_detect(Scsi_Host_Template *tpnt)
...@@ -190,6 +179,7 @@ int __init gvp11_detect(Scsi_Host_Template *tpnt) ...@@ -190,6 +179,7 @@ int __init gvp11_detect(Scsi_Host_Template *tpnt)
struct zorro_dev *z = NULL; struct zorro_dev *z = NULL;
unsigned int default_dma_xfer_mask; unsigned int default_dma_xfer_mask;
wd33c93_regs regs; wd33c93_regs regs;
int num_gvp11 = 0;
#ifdef CHECK_WD33C93 #ifdef CHECK_WD33C93
volatile unsigned char *sasr_3393, *scmd_3393; volatile unsigned char *sasr_3393, *scmd_3393;
unsigned char save_sasr; unsigned char save_sasr;
...@@ -339,13 +329,10 @@ int __init gvp11_detect(Scsi_Host_Template *tpnt) ...@@ -339,13 +329,10 @@ int __init gvp11_detect(Scsi_Host_Template *tpnt)
(epc & GVP_SCSICLKMASK) ? WD33C93_FS_8_10 (epc & GVP_SCSICLKMASK) ? WD33C93_FS_8_10
: WD33C93_FS_12_15); : WD33C93_FS_12_15);
if (num_gvp11++ == 0) { request_irq(IRQ_AMIGA_PORTS, gvp11_intr, SA_SHIRQ, "GVP11 SCSI",
first_instance = instance; instance);
gvp11_template = instance->hostt;
request_irq(IRQ_AMIGA_PORTS, gvp11_intr, SA_SHIRQ,
"GVP11 SCSI", gvp11_intr);
}
DMA(instance)->CNTR = GVP11_DMAC_INT_ENABLE; DMA(instance)->CNTR = GVP11_DMAC_INT_ENABLE;
num_gvp11++;
continue; continue;
release: release:
...@@ -391,8 +378,7 @@ int gvp11_release(struct Scsi_Host *instance) ...@@ -391,8 +378,7 @@ int gvp11_release(struct Scsi_Host *instance)
#ifdef MODULE #ifdef MODULE
DMA(instance)->CNTR = 0; DMA(instance)->CNTR = 0;
release_mem_region(ZTWO_PADDR(instance->base), 256); release_mem_region(ZTWO_PADDR(instance->base), 256);
if (--num_gvp11 == 0) free_irq(IRQ_AMIGA_PORTS, instance);
free_irq(IRQ_AMIGA_PORTS, gvp11_intr);
wd33c93_release(); wd33c93_release();
#endif #endif
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment