From 989c32394712e01e7b7b2751707e93b2a2ffb474 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Mon, 25 Nov 2002 02:39:21 -0800 Subject: [PATCH] [PATCH] pcmcia tcic region cleanups --- drivers/pcmcia/tcic.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c index 6e3b2f654179..0262afbfd3f0 100644 --- a/drivers/pcmcia/tcic.c +++ b/drivers/pcmcia/tcic.c @@ -392,7 +392,11 @@ static int __init init_tcic(void) printk(KERN_INFO "Databook TCIC-2 PCMCIA probe: "); sock = 0; - if (check_region(tcic_base, 16) == 0) { + if (!request_region(tcic_base, 16, "tcic-2")) { + printk("could not allocate ports,\n "); + return -ENODEV; + } + else { tcic_setw(TCIC_ADDR, 0); if (tcic_getw(TCIC_ADDR) == 0) { tcic_setw(TCIC_ADDR, 0xc3a5); @@ -408,16 +412,13 @@ static int __init init_tcic(void) if (tcic_getw(TCIC_ADDR) == 0xc3a5) sock = 2; } } - } else - printk("could not allocate ports, "); - + } if (sock == 0) { printk("not found.\n"); + release_region(tcic_base, 16); return -ENODEV; } - request_region(tcic_base, 16, "tcic-2"); - sockets = 0; for (i = 0; i < sock; i++) { if ((i == ignore) || is_active(i)) continue; -- 2.39.5