aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/a3000.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2009-05-17 07:35:07 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2010-05-26 13:51:07 -0400
commita8169e6057e9b7dd41c9e3b7a41efebc4bd859c9 (patch)
treee4e06ba187020ecbf54b2e9e70ef84a61046eb3a /drivers/scsi/a3000.c
parent4616ac7e84c58660a11b991460cf2611552faa76 (diff)
m68k/scsi: a3000 - Kill static global a3000_host
Acked-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'drivers/scsi/a3000.c')
-rw-r--r--drivers/scsi/a3000.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index ae9b25a3e3e7..eabc41b65dad 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -22,22 +22,21 @@
22#include <linux/stat.h> 22#include <linux/stat.h>
23 23
24 24
25static struct Scsi_Host *a3000_host = NULL;
26
27static int a3000_release(struct Scsi_Host *instance); 25static int a3000_release(struct Scsi_Host *instance);
28 26
29static irqreturn_t a3000_intr(int irq, void *dummy) 27static irqreturn_t a3000_intr(int irq, void *data)
30{ 28{
31 a3000_scsiregs *regs = (a3000_scsiregs *)(a3000_host->base); 29 struct Scsi_Host *instance = data;
30 a3000_scsiregs *regs = (a3000_scsiregs *)(instance->base);
32 unsigned int status = regs->ISTR; 31 unsigned int status = regs->ISTR;
33 unsigned long flags; 32 unsigned long flags;
34 33
35 if (!(status & ISTR_INT_P)) 34 if (!(status & ISTR_INT_P))
36 return IRQ_NONE; 35 return IRQ_NONE;
37 if (status & ISTR_INTS) { 36 if (status & ISTR_INTS) {
38 spin_lock_irqsave(a3000_host->host_lock, flags); 37 spin_lock_irqsave(instance->host_lock, flags);
39 wd33c93_intr(a3000_host); 38 wd33c93_intr(instance);
40 spin_unlock_irqrestore(a3000_host->host_lock, flags); 39 spin_unlock_irqrestore(instance->host_lock, flags);
41 return IRQ_HANDLED; 40 return IRQ_HANDLED;
42 } 41 }
43 printk("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n", status); 42 printk("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n", status);
@@ -46,8 +45,9 @@ static irqreturn_t a3000_intr(int irq, void *dummy)
46 45
47static int dma_setup(struct scsi_cmnd *cmd, int dir_in) 46static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
48{ 47{
49 struct WD33C93_hostdata *hdata = shost_priv(a3000_host); 48 struct Scsi_Host *instance = cmd->device->host;
50 a3000_scsiregs *regs = (a3000_scsiregs *)(a3000_host->base); 49 struct WD33C93_hostdata *hdata = shost_priv(instance);
50 a3000_scsiregs *regs = (a3000_scsiregs *)(instance->base);
51 unsigned short cntr = CNTR_PDMD | CNTR_INTEN; 51 unsigned short cntr = CNTR_PDMD | CNTR_INTEN;
52 unsigned long addr = virt_to_bus(cmd->SCp.ptr); 52 unsigned long addr = virt_to_bus(cmd->SCp.ptr);
53 53
@@ -164,6 +164,7 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
164 164
165static int __init a3000_detect(struct scsi_host_template *tpnt) 165static int __init a3000_detect(struct scsi_host_template *tpnt)
166{ 166{
167 struct Scsi_Host *instance;
167 wd33c93_regs wdregs; 168 wd33c93_regs wdregs;
168 a3000_scsiregs *regs; 169 a3000_scsiregs *regs;
169 struct WD33C93_hostdata *hdata; 170 struct WD33C93_hostdata *hdata;
@@ -176,31 +177,30 @@ static int __init a3000_detect(struct scsi_host_template *tpnt)
176 tpnt->proc_name = "A3000"; 177 tpnt->proc_name = "A3000";
177 tpnt->proc_info = &wd33c93_proc_info; 178 tpnt->proc_info = &wd33c93_proc_info;
178 179
179 a3000_host = scsi_register(tpnt, sizeof(struct WD33C93_hostdata)); 180 instance = scsi_register(tpnt, sizeof(struct WD33C93_hostdata));
180 if (a3000_host == NULL) 181 if (instance == NULL)
181 goto fail_register; 182 goto fail_register;
182 183
183 a3000_host->base = ZTWO_VADDR(0xDD0000); 184 instance->base = ZTWO_VADDR(0xDD0000);
184 a3000_host->irq = IRQ_AMIGA_PORTS; 185 instance->irq = IRQ_AMIGA_PORTS;
185 regs = (a3000_scsiregs *)(a3000_host->base); 186 regs = (a3000_scsiregs *)(instance->base);
186 regs->DAWR = DAWR_A3000; 187 regs->DAWR = DAWR_A3000;
187 wdregs.SASR = &regs->SASR; 188 wdregs.SASR = &regs->SASR;
188 wdregs.SCMD = &regs->SCMD; 189 wdregs.SCMD = &regs->SCMD;
189 hdata = shost_priv(a3000_host); 190 hdata = shost_priv(instance);
190 hdata->no_sync = 0xff; 191 hdata->no_sync = 0xff;
191 hdata->fast = 0; 192 hdata->fast = 0;
192 hdata->dma_mode = CTRL_DMA; 193 hdata->dma_mode = CTRL_DMA;
193 wd33c93_init(a3000_host, wdregs, dma_setup, dma_stop, 194 wd33c93_init(instance, wdregs, dma_setup, dma_stop, WD33C93_FS_12_15);
194 WD33C93_FS_12_15);
195 if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, IRQF_SHARED, "A3000 SCSI", 195 if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, IRQF_SHARED, "A3000 SCSI",
196 a3000_intr)) 196 instance))
197 goto fail_irq; 197 goto fail_irq;
198 regs->CNTR = CNTR_PDMD | CNTR_INTEN; 198 regs->CNTR = CNTR_PDMD | CNTR_INTEN;
199 199
200 return 1; 200 return 1;
201 201
202fail_irq: 202fail_irq:
203 scsi_unregister(a3000_host); 203 scsi_unregister(instance);
204fail_register: 204fail_register:
205 release_mem_region(0xDD0000, 256); 205 release_mem_region(0xDD0000, 256);
206 return 0; 206 return 0;