Re: [PATCH] drivers/cdrom/isp16.c check_region() fix

From: Christoph Hellwig
Date: Mon Dec 29 2003 - 15:08:58 EST


On Mon, Dec 29, 2003 at 02:42:23PM -0500, Omkhar Arasaratnam wrote:
> --- /usr/src/linux/drivers/cdrom/isp16.c 2001-09-07 12:28:38.000000000 -0400
> +++ drivers/cdrom/isp16.c 2003-12-29 14:07:24.000000000 -0500
> @@ -121,11 +121,12 @@
> 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);
> }
> -
> + release_region(ISP16_IO_BASE, ISP16_IO_SIZE);

This doesn't really buy you anything. You must claim the I/O ports as long
as you're possibly using them - i.e. claim them early when probing for
the device, and release them only when you're done with the device.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/