diff options
-rw-r--r-- | drivers/pcmcia/i82365.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c index 90a335a5d9fa..d72f9a35c8bd 100644 --- a/drivers/pcmcia/i82365.c +++ b/drivers/pcmcia/i82365.c | |||
@@ -669,11 +669,13 @@ static int __init is_alive(u_short sock) | |||
669 | if ((stat & I365_CS_DETECT) && (stat & I365_CS_POWERON) && | 669 | if ((stat & I365_CS_DETECT) && (stat & I365_CS_POWERON) && |
670 | (i365_get(sock, I365_INTCTL) & I365_PC_IOCARD) && | 670 | (i365_get(sock, I365_INTCTL) & I365_PC_IOCARD) && |
671 | (i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(0)) && | 671 | (i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(0)) && |
672 | (check_region(start, stop-start+1) != 0) && | 672 | ((start & 0xfeef) != 0x02e8)) { |
673 | ((start & 0xfeef) != 0x02e8)) | 673 | if (!request_region(start, stop-start+1, "i82365")) |
674 | return 1; | 674 | return 1; |
675 | else | 675 | release_region(start, stop-start+1); |
676 | return 0; | 676 | } |
677 | |||
678 | return 0; | ||
677 | } | 679 | } |
678 | 680 | ||
679 | /*====================================================================*/ | 681 | /*====================================================================*/ |
@@ -696,7 +698,13 @@ static void __init add_pcic(int ns, int type) | |||
696 | struct i82365_socket *t = &socket[sockets-ns]; | 698 | struct i82365_socket *t = &socket[sockets-ns]; |
697 | 699 | ||
698 | base = sockets-ns; | 700 | base = sockets-ns; |
699 | if (t->ioaddr > 0) request_region(t->ioaddr, 2, "i82365"); | 701 | if (t->ioaddr > 0) { |
702 | if (!request_region(t->ioaddr, 2, "i82365")) { | ||
703 | printk(KERN_ERR "i82365: IO region conflict at %#lx, not available\n", | ||
704 | t->ioaddr); | ||
705 | return; | ||
706 | } | ||
707 | } | ||
700 | 708 | ||
701 | if (base == 0) printk("\n"); | 709 | if (base == 0) printk("\n"); |
702 | printk(KERN_INFO " %s", pcic[type].name); | 710 | printk(KERN_INFO " %s", pcic[type].name); |
@@ -803,7 +811,7 @@ static void __init isa_probe(void) | |||
803 | } | 811 | } |
804 | #endif | 812 | #endif |
805 | 813 | ||
806 | if (check_region(i365_base, 2) != 0) { | 814 | if (!request_region(i365_base, 2, "i82365")) { |
807 | if (sockets == 0) | 815 | if (sockets == 0) |
808 | printk("port conflict at %#lx\n", i365_base); | 816 | printk("port conflict at %#lx\n", i365_base); |
809 | return; | 817 | return; |
@@ -1441,6 +1449,7 @@ static void __exit exit_i82365(void) | |||
1441 | i365_set(i, I365_CSCINT, 0); | 1449 | i365_set(i, I365_CSCINT, 0); |
1442 | release_region(socket[i].ioaddr, 2); | 1450 | release_region(socket[i].ioaddr, 2); |
1443 | } | 1451 | } |
1452 | release_region(i365_base, 2); | ||
1444 | #ifdef CONFIG_PNP | 1453 | #ifdef CONFIG_PNP |
1445 | if (i82365_pnpdev) | 1454 | if (i82365_pnpdev) |
1446 | pnp_disable_dev(i82365_pnpdev); | 1455 | pnp_disable_dev(i82365_pnpdev); |