Commit d93ce100 authored by Dave Jones's avatar Dave Jones

[PATCH] region handling cleanups for appletalk ltpc

parent 7b3cbc4a
...@@ -1059,26 +1059,39 @@ int __init ltpc_probe(struct net_device *dev) ...@@ -1059,26 +1059,39 @@ int __init ltpc_probe(struct net_device *dev)
int autoirq; int autoirq;
unsigned long flags; unsigned long flags;
unsigned long f; unsigned long f;
int portfound=0;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
save_flags(flags); save_flags(flags);
/* probe for the I/O port address */ /* probe for the I/O port address */
if (io != 0x240 && !check_region(0x220,8)) { if (io != 0x240 && request_region(0x220,8,"ltpc")) {
x = inb_p(0x220+6); x = inb_p(0x220+6);
if ( (x!=0xff) && (x>=0xf0) ) io = 0x220; if ( (x!=0xff) && (x>=0xf0) ) {
io = 0x220;
portfound=1;
}
else {
release_region(0x220,8);
}
} }
if (io != 0x220 && !check_region(0x240,8)) { if (io != 0x220 && request_region(0x240,8,"ltpc")) {
y = inb_p(0x240+6); y = inb_p(0x240+6);
if ( (y!=0xff) && (y>=0xf0) ) io = 0x240; if ( (y!=0xff) && (y>=0xf0) ){
io = 0x240;
portfound=1;
}
else {
release_region(0x240,8);
}
} }
if(io) { if(io && !portfound && request_region(io,8,"ltpc")){
/* found it, now grab it */ portfound = 1;
request_region(io,8,"ltpc"); }
} else { if(!portfound) {
/* give up in despair */ /* give up in despair */
printk ("LocalTalk card not found; 220 = %02x, 240 = %02x.\n", printk ("LocalTalk card not found; 220 = %02x, 240 = %02x.\n",
x,y); x,y);
......
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