From: Omkhar Arasaratnam <omkhar@rogers.com>
To: emoenke@gwdg.de
Cc: linux-kernel@vger.kernel.org, trivial@rustcorp.com.au
Subject: [PATCH] drivers/cdrom/isp16.c check_region() fix - take 2
Date: Mon, 29 Dec 2003 17:09:16 -0500 [thread overview]
Message-ID: <20031229220916.GA17210@omkhar.ibm.com> (raw)
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
next reply other threads:[~2003-12-29 22:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-29 22:09 Omkhar Arasaratnam [this message]
2003-12-31 2:35 ` Arthur Othieno
2003-12-31 16:31 ` Omkhar Arasaratnam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031229220916.GA17210@omkhar.ibm.com \
--to=omkhar@rogers.com \
--cc=emoenke@gwdg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=trivial@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®