lkml.org 
[lkml]   [2003]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] drivers/cdrom/isp16.c check_region() fix - take 2
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.145 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site