Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Stinson <wstinson@infonie.fr>2002-07-31 22:22:12 -0700
committerChristoph Hellwig <hch@sb.bsdonline.org>2002-07-31 22:22:12 -0700
commitc1bf0edc3826b33c3db7d03b652c9e44862b1c38 (patch)
treee3b936c1b08ea6b3b1857452212f68b4ec7402ea
parente72ebd7353994790565bf9a0bbf24e93fc5ab5cd (diff)
[PATCH] region changes for rocket
this is a small patch for Rocketport device driver for Linux to 1) remove two calls to check_region using request_region instead 2) release allocated region resource in case of error. I don't have this hardware so compilation checked only. This patch does not remove all references to check_region in this driver (one reference still left unchanged).
-rw-r--r--drivers/char/rocket.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 6513edfc3045..4b1509ea7eb9 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -1881,15 +1881,23 @@ static int __init init_ISA(int i, int *reserved_controller)
{
int num_aiops, num_chan;
int aiop, chan;
+ int extent = 0;
unsigned int aiopio[MAX_AIOPS_PER_BOARD];
CONTROLLER_t *ctlp;
if (rcktpt_io_addr[i] == 0)
return(0);
- if (check_region(rcktpt_io_addr[i],64)) {
+ if (rcktpt_io_addr[i] + 0x40 == controller) {
+ *reserved_controller = 1;
+ extent = 68;
+ } else {
+ extent = 64;
+ }
+ if (!request_region(rcktpt_io_addr[i], extent,
+ "Comtrol Rocketport")) {
printk("RocketPort board address 0x%lx in use...\n",
- rcktpt_io_addr[i]);
+ rcktpt_io_addr[i]);
rcktpt_io_addr[i] = 0;
return(0);
}
@@ -1901,6 +1909,7 @@ static int __init init_ISA(int i, int *reserved_controller)
aiopio, MAX_AIOPS_PER_BOARD, 0,
FREQ_DIS, 0);
if (num_aiops <= 0) {
+ release_region(rcktpt_io_addr[i], extent);
rcktpt_io_addr[i] = 0;
return(0);
}
@@ -1914,14 +1923,6 @@ static int __init init_ISA(int i, int *reserved_controller)
printk("Rocketport controller #%d found at 0x%lx, "
"%d AIOPs\n", i, rcktpt_io_addr[i],
num_aiops);
- if (rcktpt_io_addr[i] + 0x40 == controller) {
- *reserved_controller = 1;
- request_region(rcktpt_io_addr[i], 68,
- "Comtrol Rocketport");
- } else {
- request_region(rcktpt_io_addr[i], 64,
- "Comtrol Rocketport");
- }
return(1);
}