Commit c1bf0edc authored by William Stinson's avatar William Stinson Committed by Christoph Hellwig

[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).
parent e72ebd73
...@@ -1881,13 +1881,21 @@ static int __init init_ISA(int i, int *reserved_controller) ...@@ -1881,13 +1881,21 @@ static int __init init_ISA(int i, int *reserved_controller)
{ {
int num_aiops, num_chan; int num_aiops, num_chan;
int aiop, chan; int aiop, chan;
int extent = 0;
unsigned int aiopio[MAX_AIOPS_PER_BOARD]; unsigned int aiopio[MAX_AIOPS_PER_BOARD];
CONTROLLER_t *ctlp; CONTROLLER_t *ctlp;
if (rcktpt_io_addr[i] == 0) if (rcktpt_io_addr[i] == 0)
return(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", printk("RocketPort board address 0x%lx in use...\n",
rcktpt_io_addr[i]); rcktpt_io_addr[i]);
rcktpt_io_addr[i] = 0; rcktpt_io_addr[i] = 0;
...@@ -1901,6 +1909,7 @@ static int __init init_ISA(int i, int *reserved_controller) ...@@ -1901,6 +1909,7 @@ static int __init init_ISA(int i, int *reserved_controller)
aiopio, MAX_AIOPS_PER_BOARD, 0, aiopio, MAX_AIOPS_PER_BOARD, 0,
FREQ_DIS, 0); FREQ_DIS, 0);
if (num_aiops <= 0) { if (num_aiops <= 0) {
release_region(rcktpt_io_addr[i], extent);
rcktpt_io_addr[i] = 0; rcktpt_io_addr[i] = 0;
return(0); return(0);
} }
...@@ -1914,14 +1923,6 @@ static int __init init_ISA(int i, int *reserved_controller) ...@@ -1914,14 +1923,6 @@ static int __init init_ISA(int i, int *reserved_controller)
printk("Rocketport controller #%d found at 0x%lx, " printk("Rocketport controller #%d found at 0x%lx, "
"%d AIOPs\n", i, rcktpt_io_addr[i], "%d AIOPs\n", i, rcktpt_io_addr[i],
num_aiops); 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); return(1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment