From 1e641664301744f0d381de43ae1e12343e60b479 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 11 Nov 2007 19:52:05 -0500 Subject: [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 Signed-off-by: James Bottomley --- drivers/scsi/g_NCR5380.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/g_NCR5380.c') diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c index 607336f56d5..75585a52c88 100644 --- a/drivers/scsi/g_NCR5380.c +++ b/drivers/scsi/g_NCR5380.c @@ -460,7 +460,8 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt) instance->irq = NCR5380_probe_irq(instance, 0xffff); if (instance->irq != SCSI_IRQ_NONE) - if (request_irq(instance->irq, generic_NCR5380_intr, IRQF_DISABLED, "NCR5380", instance)) { + if (request_irq(instance->irq, generic_NCR5380_intr, + IRQF_DISABLED, "NCR5380", instance)) { printk(KERN_WARNING "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); instance->irq = SCSI_IRQ_NONE; } @@ -513,7 +514,7 @@ int generic_NCR5380_release_resources(struct Scsi_Host *instance) NCR5380_setup(instance); if (instance->irq != SCSI_IRQ_NONE) - free_irq(instance->irq, NULL); + free_irq(instance->irq, instance); NCR5380_exit(instance); #ifndef CONFIG_SCSI_G_NCR5380_MEM -- cgit v1.2.3