public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/cdrom/isp16.c check_region() fix - take 2
@ 2003-12-29 22:09 Omkhar Arasaratnam
  2003-12-31  2:35 ` Arthur Othieno
  0 siblings, 1 reply; 3+ messages in thread
From: Omkhar Arasaratnam @ 2003-12-29 22:09 UTC (permalink / raw)
  To: emoenke; +Cc: linux-kernel, trivial

Ok,

Thanks to all for pointing out my "kernel newbie" mistakes. Here is a new patch, let me know what you think.

Feel free to flame me if I _still_ don't get it :)


--- linux-clean/drivers/cdrom/isp16.c.org	2003-12-29 16:47:34.000000000 -0500
+++ linux-clean/drivers/cdrom/isp16.c	2003-12-29 16:47:26.000000000 -0500
@@ -121,14 +121,14 @@
 		return (0);
 	}
 
-	if (check_region(ISP16_IO_BASE, ISP16_IO_SIZE)) {
+	if (!request_region(ISP16_IO_BASE, ISP16_IO_SIZE,"isp16")) {
 		printk("ISP16: i/o ports already in use.\n");
 		return (-EIO);
 	}
 
 	if ((isp16_type = isp16_detect()) < 0) {
 		printk("ISP16: no cdrom interface found.\n");
-		return (-EIO);
+		goto out;
 	}
 
 	printk(KERN_INFO
@@ -148,20 +148,23 @@
 	else {
 		printk("ISP16: %s not supported by cdrom interface.\n",
 		       isp16_cdrom_type);
-		return (-EIO);
+		goto out;
 	}
 
 	if (isp16_cdi_config(isp16_cdrom_base, expected_drive,
 			     isp16_cdrom_irq, isp16_cdrom_dma) < 0) {
 		printk
 		    ("ISP16: cdrom interface has not been properly configured.\n");
-		return (-EIO);
+		goto out;
 	}
 	printk(KERN_INFO
 	       "ISP16: cdrom interface set up with io base 0x%03X, irq %d, dma %d,"
 	       " type %s.\n", isp16_cdrom_base, isp16_cdrom_irq,
 	       isp16_cdrom_dma, isp16_cdrom_type);
 	return (0);
+:out
+	release_region(ISP16_IO_BASE, ISP16_IO_SIZE);
+	return (-EIO);
 }
 
 static short __init isp16_detect(void)


 O

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-31 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-29 22:09 [PATCH] drivers/cdrom/isp16.c check_region() fix - take 2 Omkhar Arasaratnam
2003-12-31  2:35 ` Arthur Othieno
2003-12-31 16:31   ` Omkhar Arasaratnam

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