aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/atari_scsi.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-11-11 19:52:05 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2007-11-25 05:19:26 -0500
commit1e641664301744f0d381de43ae1e12343e60b479 (patch)
tree974c977e1dd9787c943d16b771372f08b48f346d /drivers/scsi/atari_scsi.c
parent86e8dfc5603ed76917eed0a9dd9e85a1e1a8b162 (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/atari_scsi.c')
-rw-r--r--drivers/scsi/atari_scsi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index 6f8403b82ba1..f5732d8f67fe 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -393,7 +393,7 @@ static irqreturn_t scsi_tt_intr(int irq, void *dummy)
393 393
394#endif /* REAL_DMA */ 394#endif /* REAL_DMA */
395 395
396 NCR5380_intr(0, 0); 396 NCR5380_intr(irq, dummy);
397 397
398#if 0 398#if 0
399 /* To be sure the int is not masked */ 399 /* To be sure the int is not masked */
@@ -458,7 +458,7 @@ static irqreturn_t scsi_falcon_intr(int irq, void *dummy)
458 458
459#endif /* REAL_DMA */ 459#endif /* REAL_DMA */
460 460
461 NCR5380_intr(0, 0); 461 NCR5380_intr(irq, dummy);
462 return IRQ_HANDLED; 462 return IRQ_HANDLED;
463} 463}
464 464
@@ -684,7 +684,7 @@ int atari_scsi_detect(struct scsi_host_template *host)
684 * interrupt after having cleared the pending flag for the DMA 684 * interrupt after having cleared the pending flag for the DMA
685 * interrupt. */ 685 * interrupt. */
686 if (request_irq(IRQ_TT_MFP_SCSI, scsi_tt_intr, IRQ_TYPE_SLOW, 686 if (request_irq(IRQ_TT_MFP_SCSI, scsi_tt_intr, IRQ_TYPE_SLOW,
687 "SCSI NCR5380", scsi_tt_intr)) { 687 "SCSI NCR5380", instance)) {
688 printk(KERN_ERR "atari_scsi_detect: cannot allocate irq %d, aborting",IRQ_TT_MFP_SCSI); 688 printk(KERN_ERR "atari_scsi_detect: cannot allocate irq %d, aborting",IRQ_TT_MFP_SCSI);
689 scsi_unregister(atari_scsi_host); 689 scsi_unregister(atari_scsi_host);
690 atari_stram_free(atari_dma_buffer); 690 atari_stram_free(atari_dma_buffer);
@@ -701,7 +701,7 @@ int atari_scsi_detect(struct scsi_host_template *host)
701 IRQ_TYPE_PRIO, "Hades DMA emulator", 701 IRQ_TYPE_PRIO, "Hades DMA emulator",
702 hades_dma_emulator)) { 702 hades_dma_emulator)) {
703 printk(KERN_ERR "atari_scsi_detect: cannot allocate irq %d, aborting (MACH_IS_HADES)",IRQ_AUTO_2); 703 printk(KERN_ERR "atari_scsi_detect: cannot allocate irq %d, aborting (MACH_IS_HADES)",IRQ_AUTO_2);
704 free_irq(IRQ_TT_MFP_SCSI, scsi_tt_intr); 704 free_irq(IRQ_TT_MFP_SCSI, instance);
705 scsi_unregister(atari_scsi_host); 705 scsi_unregister(atari_scsi_host);
706 atari_stram_free(atari_dma_buffer); 706 atari_stram_free(atari_dma_buffer);
707 atari_dma_buffer = 0; 707 atari_dma_buffer = 0;
@@ -761,7 +761,7 @@ int atari_scsi_detect(struct scsi_host_template *host)
761int atari_scsi_release(struct Scsi_Host *sh) 761int atari_scsi_release(struct Scsi_Host *sh)
762{ 762{
763 if (IS_A_TT()) 763 if (IS_A_TT())
764 free_irq(IRQ_TT_MFP_SCSI, scsi_tt_intr); 764 free_irq(IRQ_TT_MFP_SCSI, sh);
765 if (atari_dma_buffer) 765 if (atari_dma_buffer)
766 atari_stram_free(atari_dma_buffer); 766 atari_stram_free(atari_dma_buffer);
767 return 1; 767 return 1;