diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-06-27 19:28:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 21:03:21 -0400 |
commit | f354942cb301fed273f423fb5c4f57bde3efc5b2 (patch) | |
tree | 0064f004c20d2b8c17cb94bd42b3cbc765d7c4f9 /drivers/pcmcia/i82365.c | |
parent | 378a33a686d457fa5a38d6ad134f5385a9cc7860 (diff) |
[PATCH] pcmcia: use request_region in i82365
randy_dunlap <rdunlap@xenotime.net>
Convert deprecated check_region() calls to request/release region.
Add return value check on one request_region().
I suspect that it may do an extra release_region(), which should
generate a warning message from the kernel.
Signed-off-by: randy_dunlap <rdunlap@xenotime.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pcmcia/i82365.c')
-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); |