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>
This commit is contained in:
Родитель
4616ac7e84
Коммит
a8169e6057
|
@ -22,22 +22,21 @@
|
||||||
#include <linux/stat.h>
|
#include <linux/stat.h>
|
||||||
|
|
||||||
|
|
||||||
static struct Scsi_Host *a3000_host = NULL;
|
|
||||||
|
|
||||||
static int a3000_release(struct Scsi_Host *instance);
|
static int a3000_release(struct Scsi_Host *instance);
|
||||||
|
|
||||||
static irqreturn_t a3000_intr(int irq, void *dummy)
|
static irqreturn_t a3000_intr(int irq, void *data)
|
||||||
{
|
{
|
||||||
a3000_scsiregs *regs = (a3000_scsiregs *)(a3000_host->base);
|
struct Scsi_Host *instance = data;
|
||||||
|
a3000_scsiregs *regs = (a3000_scsiregs *)(instance->base);
|
||||||
unsigned int status = regs->ISTR;
|
unsigned int status = regs->ISTR;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
if (!(status & ISTR_INT_P))
|
if (!(status & ISTR_INT_P))
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
if (status & ISTR_INTS) {
|
if (status & ISTR_INTS) {
|
||||||
spin_lock_irqsave(a3000_host->host_lock, flags);
|
spin_lock_irqsave(instance->host_lock, flags);
|
||||||
wd33c93_intr(a3000_host);
|
wd33c93_intr(instance);
|
||||||
spin_unlock_irqrestore(a3000_host->host_lock, flags);
|
spin_unlock_irqrestore(instance->host_lock, flags);
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
printk("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n", status);
|
printk("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n", status);
|
||||||
|
@ -46,8 +45,9 @@ static irqreturn_t a3000_intr(int irq, void *dummy)
|
||||||
|
|
||||||
static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
|
static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
|
||||||
{
|
{
|
||||||
struct WD33C93_hostdata *hdata = shost_priv(a3000_host);
|
struct Scsi_Host *instance = cmd->device->host;
|
||||||
a3000_scsiregs *regs = (a3000_scsiregs *)(a3000_host->base);
|
struct WD33C93_hostdata *hdata = shost_priv(instance);
|
||||||
|
a3000_scsiregs *regs = (a3000_scsiregs *)(instance->base);
|
||||||
unsigned short cntr = CNTR_PDMD | CNTR_INTEN;
|
unsigned short cntr = CNTR_PDMD | CNTR_INTEN;
|
||||||
unsigned long addr = virt_to_bus(cmd->SCp.ptr);
|
unsigned long addr = virt_to_bus(cmd->SCp.ptr);
|
||||||
|
|
||||||
|
@ -164,6 +164,7 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
|
||||||
|
|
||||||
static int __init a3000_detect(struct scsi_host_template *tpnt)
|
static int __init a3000_detect(struct scsi_host_template *tpnt)
|
||||||
{
|
{
|
||||||
|
struct Scsi_Host *instance;
|
||||||
wd33c93_regs wdregs;
|
wd33c93_regs wdregs;
|
||||||
a3000_scsiregs *regs;
|
a3000_scsiregs *regs;
|
||||||
struct WD33C93_hostdata *hdata;
|
struct WD33C93_hostdata *hdata;
|
||||||
|
@ -176,31 +177,30 @@ static int __init a3000_detect(struct scsi_host_template *tpnt)
|
||||||
tpnt->proc_name = "A3000";
|
tpnt->proc_name = "A3000";
|
||||||
tpnt->proc_info = &wd33c93_proc_info;
|
tpnt->proc_info = &wd33c93_proc_info;
|
||||||
|
|
||||||
a3000_host = scsi_register(tpnt, sizeof(struct WD33C93_hostdata));
|
instance = scsi_register(tpnt, sizeof(struct WD33C93_hostdata));
|
||||||
if (a3000_host == NULL)
|
if (instance == NULL)
|
||||||
goto fail_register;
|
goto fail_register;
|
||||||
|
|
||||||
a3000_host->base = ZTWO_VADDR(0xDD0000);
|
instance->base = ZTWO_VADDR(0xDD0000);
|
||||||
a3000_host->irq = IRQ_AMIGA_PORTS;
|
instance->irq = IRQ_AMIGA_PORTS;
|
||||||
regs = (a3000_scsiregs *)(a3000_host->base);
|
regs = (a3000_scsiregs *)(instance->base);
|
||||||
regs->DAWR = DAWR_A3000;
|
regs->DAWR = DAWR_A3000;
|
||||||
wdregs.SASR = ®s->SASR;
|
wdregs.SASR = ®s->SASR;
|
||||||
wdregs.SCMD = ®s->SCMD;
|
wdregs.SCMD = ®s->SCMD;
|
||||||
hdata = shost_priv(a3000_host);
|
hdata = shost_priv(instance);
|
||||||
hdata->no_sync = 0xff;
|
hdata->no_sync = 0xff;
|
||||||
hdata->fast = 0;
|
hdata->fast = 0;
|
||||||
hdata->dma_mode = CTRL_DMA;
|
hdata->dma_mode = CTRL_DMA;
|
||||||
wd33c93_init(a3000_host, wdregs, dma_setup, dma_stop,
|
wd33c93_init(instance, wdregs, dma_setup, dma_stop, WD33C93_FS_12_15);
|
||||||
WD33C93_FS_12_15);
|
|
||||||
if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, IRQF_SHARED, "A3000 SCSI",
|
if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, IRQF_SHARED, "A3000 SCSI",
|
||||||
a3000_intr))
|
instance))
|
||||||
goto fail_irq;
|
goto fail_irq;
|
||||||
regs->CNTR = CNTR_PDMD | CNTR_INTEN;
|
regs->CNTR = CNTR_PDMD | CNTR_INTEN;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
fail_irq:
|
fail_irq:
|
||||||
scsi_unregister(a3000_host);
|
scsi_unregister(instance);
|
||||||
fail_register:
|
fail_register:
|
||||||
release_mem_region(0xDD0000, 256);
|
release_mem_region(0xDD0000, 256);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче