Convert one check_region() to request/release region. Remove second check_region since a following request_region() now does it. Added return value check on that request_region(). Signed-off-by: Randy Dunlap diffstat:= drivers/pcmcia/i82365.c | 27 +++++++++++++++------------ 1 files changed, 15 insertions(+), 12 deletions(-) diff -Naurp ./drivers/pcmcia/i82365.c~req_region_rc ./drivers/pcmcia/i82365.c --- ./drivers/pcmcia/i82365.c~req_region_rc 2005-01-18 07:25:41.619900600 -0800 +++ ./drivers/pcmcia/i82365.c 2005-01-18 16:06:14.127837688 -0800 @@ -668,11 +668,14 @@ static int __init is_alive(u_short sock) if ((stat & I365_CS_DETECT) && (stat & I365_CS_POWERON) && (i365_get(sock, I365_INTCTL) & I365_PC_IOCARD) && (i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(0)) && - (check_region(start, stop-start+1) != 0) && - ((start & 0xfeef) != 0x02e8)) - return 1; - else - return 0; + ((start & 0xfeef) != 0x02e8)) { + struct resource *res = request_region(start, stop-start+1, "i82365"); + if (!res) + return 1; + release_region(start, stop-start+1); + } + + return 0; } /*====================================================================*/ @@ -695,7 +698,13 @@ static void __init add_pcic(int ns, int struct i82365_socket *t = &socket[sockets-ns]; base = sockets-ns; - if (t->ioaddr > 0) request_region(t->ioaddr, 2, "i82365"); + if (t->ioaddr > 0) { + if (!request_region(t->ioaddr, 2, "i82365")) { + printk(KERN_ERR "i82365: IO region conflict at %#lx, not available\n", + t->ioaddr); + return; + } + } if (base == 0) printk("\n"); printk(KERN_INFO " %s", pcic[type].name); @@ -802,12 +811,6 @@ static void __init isa_probe(void) } #endif - if (check_region(i365_base, 2) != 0) { - if (sockets == 0) - printk("port conflict at %#lx\n", i365_base); - return; - } - id = identify(i365_base, 0); if ((id == IS_I82365DF) && (identify(i365_base, 1) != id)) { for (i = 0; i < 4; i++) {