public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/scsi/fd_mcs.c cleanup (241p9)
@ 2001-01-22 23:38 Rasmus Andersen
  0 siblings, 0 replies; only message in thread
From: Rasmus Andersen @ 2001-01-22 23:38 UTC (permalink / raw)
  To: faith; +Cc: linux-kernel, linux-scsi

Hi.

(I am guessing you as maintainer of this code. If you are not,
I apologise.)

The following patch makes drivers/scsi/fd_mcs.c use the return
code of request_region instead of check_region. It also makes
the driver release the irq on error. It applies cleanly against
ac10 and 241p9.

Comments?


--- linux-ac10-clean/drivers/scsi/fd_mcs.c	Mon Sep 18 22:36:25 2000
+++ linux-ac10/drivers/scsi/fd_mcs.c	Mon Jan 22 22:55:53 2001
@@ -406,23 +406,24 @@
 	/* claim the slot */
 	mca_set_adapter_name( slot-1, fd_mcs_adapters[loop].name );
 
-	/* check irq/region */
-	if (check_region(port, 0x10) ||
-	    request_irq(irq, fd_mcs_intr,
-			SA_SHIRQ, "fd_mcs", hosts)) {
-	  printk( "fd_mcs: check_region() || request_irq() failed, Skip it\n");
-
+	/* check/get irq/region */
+	if (!request_region(port, 0x10, "fd_mcs") ) {
+	  printk(KERN_WARNING "fd_mcs: request_region() failed, Skip it\n");
 	  continue;
 	}
+		
+	if (request_irq(irq, fd_mcs_intr, SA_SHIRQ, "fd_mcs", hosts)) {
+	  printk(KERN_WARNING "fd_mcs: request_irq() failed, Skip it\n");
+	  goto err_release;
+	}
 
 	/* register */
 	if (!(shpnt = scsi_register(tpnt, sizeof(struct fd_hostdata)))) {
 	  printk( "fd_mcs: scsi_register() failed\n");
-	  continue;
+	  goto err_free_irq;
 	}
 
 	/* request I/O region */
-	request_region( port, 0x10, "fd_mcs" );
 
 	/* save name */
 	strcpy(adapter_name, fd_mcs_adapters[loop].name);
@@ -578,6 +579,12 @@
 	      FD_MAX_HOSTS);
       break;
     }
+    continue;
+
+  err_free_irq:
+    free_irq(irq, fd_mcs_intr);
+  err_release:
+    release_region(port, 0x10);
   }
 
   return found;

-- 
Regards,
        Rasmus(rasmus@jaquet.dk)

Three things are certain:
Death, taxes, and lost data.
Guess which has occurred. --- Error messages in haiku
-
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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-01-22 23:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-22 23:38 [PATCH] drivers/scsi/fd_mcs.c cleanup (241p9) Rasmus Andersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox