linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/cdrom/cm206.c trivial check_region() fix
@ 2004-01-02 17:25 Omkhar Arasaratnam
  0 siblings, 0 replies; only message in thread
From: Omkhar Arasaratnam @ 2004-01-02 17:25 UTC (permalink / raw)
  To: emoenke; +Cc: linux-kernel, mbligh, trivial, randy

check_region() fix


--- linux-clean/drivers/cdrom/cm206.c.org	2004-01-02 12:09:49.000000000 -0500
+++ linux-clean/drivers/cdrom/cm206.c	2004-01-02 12:22:23.000000000 -0500
@@ -1389,7 +1389,7 @@
 
    Linus says it is too dangerous to use writes for probing, so we
    stick with pure reads for a while. Hope that 8 possible ranges,
-   check_region, 15 bits of one port and 6 of another make things
+   request_region, 15 bits of one port and 6 of another make things
    likely enough to accept the region on the first hit...
  */
 int __init probe_base_port(int base)
@@ -1400,13 +1400,15 @@
 	if (base)
 		b = e = base;
 	for (base = b; base <= e; base += 0x10) {
-		if (check_region(base, 0x10))
+		if (!request_region(base, 0x10,"cm206"))
 			continue;
 		for (i = 0; i < 3; i++)
 			fool = inw(base + 2);	/* empty possibly uart_receive_buffer */
 		if ((inw(base + 6) & 0xffef) != 0x0001 ||	/* line_status */
-		    (inw(base) & 0xad00) != 0)	/* data status */
+		    (inw(base) & 0xad00) != 0)	{ /* data status */
+		    	release_region(base,0x10);
 			continue;
+		}
 		return (base);
 	}
 	return 0;
@@ -1444,7 +1446,6 @@
 		return -EIO;
 	}
 	printk(" adapter at 0x%x", cm206_base);
-	request_region(cm206_base, 16, "cm206");
 	cd = (struct cm206_struct *) kmalloc(size, GFP_KERNEL);
 	if (!cd)
                goto out_base;

O

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

only message in thread, other threads:[~2004-01-02 17:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-02 17:25 [PATCH] drivers/cdrom/cm206.c trivial check_region() fix Omkhar Arasaratnam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).