Re: [PATCH] make drivers/scsi/atari_scsi.c check request_irq (240p3)

Jeff Garzik (jgarzik@mandrakesoft.com)
Sun, 14 Jan 2001 16:29:11 -0500


Rasmus Andersen wrote:
>
> Hi.
>
> The following patch makes drivers/scsi/atari_scsi.c check request_irq's
> return code. It applies cleanly against 240p3 and ac9.
>
> Comments?
>
> --- linux-ac9/drivers/scsi/atari_scsi.c~ Tue Nov 28 02:57:34 2000
> +++ linux-ac9/drivers/scsi/atari_scsi.c Sun Jan 14 19:28:00 2001
> @@ -690,19 +690,27 @@
> /* This int is actually "pseudo-slow", i.e. it acts like a slow
> * interrupt after having cleared the pending flag for the DMA
> * interrupt. */
> - request_irq(IRQ_TT_MFP_SCSI, scsi_tt_intr, IRQ_TYPE_SLOW,
> - "SCSI NCR5380", scsi_tt_intr);
> + if (!request_irq(IRQ_TT_MFP_SCSI, scsi_tt_intr, IRQ_TYPE_SLOW,
> + "SCSI NCR5380", scsi_tt_intr)) {
> + printk(KERN_ERR "atari_scsi_detect: cannot allocate irq %d, aborting",IRQ_TT_MFP_SCSI);
> + atari_stram_free(atari_dma_buffer);
> + atari_dma_buffer = 0;
> + return 0;
> + }

request_irq returns zero on success, not on failure. Further, you need
to return the request_irq error value back to the caller, if possible.

Jeff

-- 
Jeff Garzik       | "You see, in this world there's two kinds of
Building 1024     |  people, my friend: Those with loaded guns
MandrakeSoft      |  and those who dig. You dig."  --Blondie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/