From: Geert Uytterhoeven <geert@linux-m68k.org>
To: "James E.J. Bottomley" <James.Bottomley@suse.de>
Cc: linux-m68k@lists.linux-m68k.org, linux-scsi@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH 14/21] m68k/scsi: a3000 - Kill static global a3000_host
Date: Sun, 4 Apr 2010 11:00:44 +0200 [thread overview]
Message-ID: <1270371651-2584-15-git-send-email-geert@linux-m68k.org> (raw)
In-Reply-To: <1270371651-2584-14-git-send-email-geert@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
drivers/scsi/a3000.c | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index 296b58b..008a999 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -21,22 +21,21 @@
#include <linux/stat.h>
-static struct Scsi_Host *a3000_host = NULL;
-
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 long flags;
if (!(status & ISTR_INT_P))
return IRQ_NONE;
if (status & ISTR_INTS) {
- spin_lock_irqsave(a3000_host->host_lock, flags);
- wd33c93_intr(a3000_host);
- spin_unlock_irqrestore(a3000_host->host_lock, flags);
+ spin_lock_irqsave(instance->host_lock, flags);
+ wd33c93_intr(instance);
+ spin_unlock_irqrestore(instance->host_lock, flags);
return IRQ_HANDLED;
}
printk("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n", status);
@@ -45,8 +44,9 @@ static irqreturn_t a3000_intr(int irq, void *dummy)
static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
{
- struct WD33C93_hostdata *hdata = shost_priv(a3000_host);
- a3000_scsiregs *regs = (a3000_scsiregs *)(a3000_host->base);
+ struct Scsi_Host *instance = cmd->device->host;
+ struct WD33C93_hostdata *hdata = shost_priv(instance);
+ a3000_scsiregs *regs = (a3000_scsiregs *)(instance->base);
unsigned short cntr = CNTR_PDMD | CNTR_INTEN;
unsigned long addr = virt_to_bus(cmd->SCp.ptr);
@@ -163,6 +163,7 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
static int __init a3000_detect(struct scsi_host_template *tpnt)
{
+ struct Scsi_Host *instance;
wd33c93_regs wdregs;
a3000_scsiregs *regs;
struct WD33C93_hostdata *hdata;
@@ -175,31 +176,30 @@ static int __init a3000_detect(struct scsi_host_template *tpnt)
tpnt->proc_name = "A3000";
tpnt->proc_info = &wd33c93_proc_info;
- a3000_host = scsi_register(tpnt, sizeof(struct WD33C93_hostdata));
- if (a3000_host == NULL)
+ instance = scsi_register(tpnt, sizeof(struct WD33C93_hostdata));
+ if (instance == NULL)
goto fail_register;
- a3000_host->base = ZTWO_VADDR(0xDD0000);
- a3000_host->irq = IRQ_AMIGA_PORTS;
- regs = (a3000_scsiregs *)(a3000_host->base);
+ instance->base = ZTWO_VADDR(0xDD0000);
+ instance->irq = IRQ_AMIGA_PORTS;
+ regs = (a3000_scsiregs *)(instance->base);
regs->DAWR = DAWR_A3000;
wdregs.SASR = ®s->SASR;
wdregs.SCMD = ®s->SCMD;
- hdata = shost_priv(a3000_host);
+ hdata = shost_priv(instance);
hdata->no_sync = 0xff;
hdata->fast = 0;
hdata->dma_mode = CTRL_DMA;
- wd33c93_init(a3000_host, wdregs, dma_setup, dma_stop,
- WD33C93_FS_12_15);
+ wd33c93_init(instance, wdregs, dma_setup, dma_stop, WD33C93_FS_12_15);
if (request_irq(IRQ_AMIGA_PORTS, a3000_intr, IRQF_SHARED, "A3000 SCSI",
- a3000_intr))
+ instance))
goto fail_irq;
regs->CNTR = CNTR_PDMD | CNTR_INTEN;
return 1;
fail_irq:
- scsi_unregister(a3000_host);
+ scsi_unregister(instance);
fail_register:
release_mem_region(0xDD0000, 256);
return 0;
--
1.6.0.4
next prev parent reply other threads:[~2010-04-04 9:00 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-04 9:00 [PATCH 0/21] m68k/scsi: wd33c93 driver cleanups Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 01/21] scsi: wd33c93 - Kill empty wd33c93_release() Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 02/21] m68k/scsi: a2091 - Reindentation Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 03/21] m68k/scsi: gvp11 " Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 04/21] m68k/scsi: mvme147 " Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 05/21] m68k/scsi: a3000 " Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 06/21] m68k/scsi: a2091 - Use shost_priv() and kill ugly HDATA() macro Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 07/21] m68k/scsi: gvp11 " Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 08/21] m68k/scsi: mvme147 " Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 09/21] m68k/scsi: a3000 " Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 10/21] m68k/scsi: a2091 - Kill ugly DMA() macro Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 11/21] m68k/scsi: gvp11 " Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 12/21] m68k/scsi: a3000 " Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 13/21] m68k/scsi: mvme147 - Kill static global mvme147_host Geert Uytterhoeven
2010-04-04 9:00 ` Geert Uytterhoeven [this message]
2010-04-04 9:00 ` [PATCH 15/21] m68k/scsi: gvp11 - Extract check_wd33c93() Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 16/21] m68k/scsi: a2091 - Kill a2091_scsiregs typedef Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 17/21] m68k/scsi: gvp11 - Kill gvp11_scsiregs typedef Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 18/21] m68k/scsi: a3000 - Kill a3000_scsiregs typedef Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 19/21] m68k/scsi: mvme147 - Kill obsolete HOSTS_C logic Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 20/21] m68k: amiga - A2091/A590 SCSI zorro_driver conversion Geert Uytterhoeven
2010-04-04 9:00 ` [PATCH 21/21] m68k: amiga - GVP Series II " Geert Uytterhoeven
2010-04-05 6:25 ` [PATCH 10/21] m68k/scsi: a2091 - Kill ugly DMA() macro Christoph Hellwig
[not found] ` <20100405062529.GA28950@infradead.org>
2010-04-05 19:42 ` Geert Uytterhoeven
2010-04-23 8:37 ` Geert Uytterhoeven
2010-04-23 8:38 ` Geert Uytterhoeven
2010-04-23 8:40 ` Geert Uytterhoeven
2010-04-23 10:15 ` [PATCH] SCSI: sgiwd93: remove use of legacy base field of host struct Ralf Baechle
2010-04-23 10:26 ` [PATCH] SCSI: sgiwd93: Convert to use shost_priv() Ralf Baechle
2010-05-02 20:05 ` [PATCH 10/21] m68k/scsi: a2091 - Kill ugly DMA() macro James Bottomley
2010-05-03 19:25 ` Geert Uytterhoeven
2010-05-13 19:41 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1270371651-2584-15-git-send-email-geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=James.Bottomley@suse.de \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox