diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-11-11 19:52:05 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2007-11-25 05:19:26 -0500 |
commit | 1e641664301744f0d381de43ae1e12343e60b479 (patch) | |
tree | 974c977e1dd9787c943d16b771372f08b48f346d /drivers/scsi/t128.c | |
parent | 86e8dfc5603ed76917eed0a9dd9e85a1e1a8b162 (diff) |
[SCSI] NCR5380: Fix bugs and canonicalize irq handler usage
* Always pass the same value to free_irq() that we pass to
request_irq(). This fixes several bugs.
* Always call NCR5380_intr() with 'irq' and 'dev_id' arguments.
Note, scsi_falcon_intr() is the only case now where dev_id is not the
scsi_host.
* Always pass Scsi_Host to request_irq(). For most cases, the drivers
already did so, and I merely neated the source code line. In other
cases, either NULL or a non-sensical value was passed, verified to be
unused, then changed to be Scsi_Host in anticipation of the future.
In addition to the bugs fixes, this change makes the interface usage
consistent, which in turn enables the possibility of directly
referencing Scsi_Host from all NCR5380_intr() invocations.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/t128.c')
-rw-r--r-- | drivers/scsi/t128.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c index 248d60b8d899..041eaaace2c3 100644 --- a/drivers/scsi/t128.c +++ b/drivers/scsi/t128.c | |||
@@ -259,7 +259,8 @@ found: | |||
259 | instance->irq = NCR5380_probe_irq(instance, T128_IRQS); | 259 | instance->irq = NCR5380_probe_irq(instance, T128_IRQS); |
260 | 260 | ||
261 | if (instance->irq != SCSI_IRQ_NONE) | 261 | if (instance->irq != SCSI_IRQ_NONE) |
262 | if (request_irq(instance->irq, t128_intr, IRQF_DISABLED, "t128", instance)) { | 262 | if (request_irq(instance->irq, t128_intr, IRQF_DISABLED, "t128", |
263 | instance)) { | ||
263 | printk("scsi%d : IRQ%d not free, interrupts disabled\n", | 264 | printk("scsi%d : IRQ%d not free, interrupts disabled\n", |
264 | instance->host_no, instance->irq); | 265 | instance->host_no, instance->irq); |
265 | instance->irq = SCSI_IRQ_NONE; | 266 | instance->irq = SCSI_IRQ_NONE; |
@@ -295,7 +296,7 @@ static int t128_release(struct Scsi_Host *shost) | |||
295 | NCR5380_local_declare(); | 296 | NCR5380_local_declare(); |
296 | NCR5380_setup(shost); | 297 | NCR5380_setup(shost); |
297 | if (shost->irq) | 298 | if (shost->irq) |
298 | free_irq(shost->irq, NULL); | 299 | free_irq(shost->irq, shost); |
299 | NCR5380_exit(shost); | 300 | NCR5380_exit(shost); |
300 | if (shost->io_port && shost->n_io_port) | 301 | if (shost->io_port && shost->n_io_port) |
301 | release_region(shost->io_port, shost->n_io_port); | 302 | release_region(shost->io_port, shost->n_io_port); |