From: Jeff Garzik <jeff@garzik.org>
To: linux-scsi@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 07/15] [SCSI] aha1542: minor irq handler cleanups
Date: Fri, 18 Apr 2008 19:22:54 -0400 (EDT) [thread overview]
Message-ID: <70159e4a9060dee3fee3d41e22a4d78c5ba95120.1208559659.git.jgarzik@redhat.com> (raw)
In-Reply-To: <d7afbccda111e535bb14ad8082b208c7a2cd9833.1208559659.git.jgarzik@redhat.com>
- where the 'irq' function argument is known never to be used, rename
it to 'dummy' to make this more obvious
- replace per-irq lookup functions and tables with a direct reference
to data object obtained via 'dev_id' function argument, passed from
request_irq()
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
drivers/scsi/aha1542.c | 22 ++++++++--------------
1 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 5a1471c..1375915 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -153,8 +153,6 @@ struct aha1542_hostdata {
#define HOSTDATA(host) ((struct aha1542_hostdata *) &host->hostdata)
-static struct Scsi_Host *aha_host[7]; /* One for each IRQ level (9-15) */
-
static DEFINE_SPINLOCK(aha1542_lock);
@@ -163,8 +161,7 @@ static DEFINE_SPINLOCK(aha1542_lock);
static void setup_mailboxes(int base_io, struct Scsi_Host *shpnt);
static int aha1542_restart(struct Scsi_Host *shost);
-static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id);
-static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id);
+static void aha1542_intr_handle(struct Scsi_Host *shost);
#define aha1542_intr_reset(base) outb(IRST, CONTROL(base))
@@ -404,23 +401,19 @@ fail:
}
/* A quick wrapper for do_aha1542_intr_handle to grab the spin lock */
-static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id)
+static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id)
{
unsigned long flags;
- struct Scsi_Host *shost;
-
- shost = aha_host[irq - 9];
- if (!shost)
- panic("Splunge!");
+ struct Scsi_Host *shost = dev_id;
spin_lock_irqsave(shost->host_lock, flags);
- aha1542_intr_handle(shost, dev_id);
+ aha1542_intr_handle(shost);
spin_unlock_irqrestore(shost->host_lock, flags);
return IRQ_HANDLED;
}
/* A "high" level interrupt handler */
-static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id)
+static void aha1542_intr_handle(struct Scsi_Host *shost)
{
void (*my_done) (Scsi_Cmnd *) = NULL;
int errstatus, mbi, mbo, mbistatus;
@@ -1197,7 +1190,8 @@ fail:
DEB(printk("aha1542_detect: enable interrupt channel %d\n", irq_level));
spin_lock_irqsave(&aha1542_lock, flags);
- if (request_irq(irq_level, do_aha1542_intr_handle, 0, "aha1542", NULL)) {
+ if (request_irq(irq_level, do_aha1542_intr_handle, 0,
+ "aha1542", shpnt)) {
printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n");
spin_unlock_irqrestore(&aha1542_lock, flags);
goto unregister;
@@ -1214,7 +1208,7 @@ fail:
enable_dma(dma_chan);
}
}
- aha_host[irq_level - 9] = shpnt;
+
shpnt->this_id = scsi_id;
shpnt->unique_id = base_io;
shpnt->io_port = base_io;
--
1.5.4.1
next prev parent reply other threads:[~2008-04-18 23:25 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
2008-04-18 23:22 ` [PATCH 02/15] [SPARC] " Jeff Garzik
2008-04-18 23:33 ` David Miller
2008-04-18 23:22 ` [PATCH 03/15] [BLACKFIN] " Jeff Garzik
2008-04-22 3:27 ` Bryan Wu
2008-04-18 23:22 ` [PATCH 04/15] [PPC] " Jeff Garzik
2008-04-19 14:57 ` Kumar Gala
2008-04-18 23:22 ` [PATCH 05/15] drivers/char: " Jeff Garzik
2008-04-19 6:00 ` Rogier Wolff
2008-04-22 8:05 ` Benjamin Herrenschmidt
2008-04-22 10:13 ` Rogier Wolff
2008-04-22 10:46 ` Benjamin Herrenschmidt
2008-04-19 16:16 ` Alan Cox
2008-04-21 1:38 ` Jeff Garzik
2008-04-18 23:22 ` [PATCH 06/15] [SCSI] " Jeff Garzik
2008-04-18 23:22 ` Jeff Garzik [this message]
2008-04-18 23:22 ` [PATCH 08/15] [ISDN] " Jeff Garzik
2008-04-18 23:22 ` [PATCH 09/15] [AVR32] remove unused 'irq' argument from local_timer_interrupt() Jeff Garzik
2008-04-18 23:22 ` [PATCH 10/15] [IA64] minor irq handler cleanups Jeff Garzik
2008-04-18 23:23 ` [PATCH 11/15] [RTC] " Jeff Garzik
2008-04-18 23:23 ` [PATCH 12/15] [MIPS] pmc-sierra/msp71xx/msp_hwbutton.c: " Jeff Garzik
2008-04-28 20:53 ` Ralf Baechle
2008-04-18 23:23 ` [PATCH 13/15] [X86] standard vm86 irq handler Jeff Garzik
2008-04-21 13:52 ` Ingo Molnar
2008-04-18 23:23 ` [PATCH 14/15] Canonicalize several irq handlers Jeff Garzik
2008-04-18 23:23 ` [PATCH 15/15] [INPUT, PCMCIA] avoid use of 'irq' function arg Jeff Garzik
2008-04-18 23:29 ` [PATCH 01/15] ARM minor irq handler cleanups Lennert Buytenhek
2008-04-19 0:25 ` Jeff Garzik
2008-04-19 16:14 ` Lennert Buytenhek
2008-04-18 23:44 ` Andrew Morton
2008-04-19 0:21 ` Jeff Garzik
2008-04-19 1:17 ` Andrew Morton
2008-04-20 22:17 ` Jeff Garzik
2008-04-20 22:40 ` Russell King
2008-04-20 22:49 ` Jeff Garzik
2008-04-19 8:17 ` Russell King
2008-04-19 8:28 ` Jeff Garzik
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=70159e4a9060dee3fee3d41e22a4d78c5ba95120.1208559659.git.jgarzik@redhat.com \
--to=jeff@garzik.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).