Commit f354942c authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Linus Torvalds

[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: default avatarrandy_dunlap <rdunlap@xenotime.net>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 378a33a6
...@@ -669,11 +669,13 @@ static int __init is_alive(u_short sock) ...@@ -669,11 +669,13 @@ static int __init is_alive(u_short sock)
if ((stat & I365_CS_DETECT) && (stat & I365_CS_POWERON) && if ((stat & I365_CS_DETECT) && (stat & I365_CS_POWERON) &&
(i365_get(sock, I365_INTCTL) & I365_PC_IOCARD) && (i365_get(sock, I365_INTCTL) & I365_PC_IOCARD) &&
(i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(0)) && (i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(0)) &&
(check_region(start, stop-start+1) != 0) && ((start & 0xfeef) != 0x02e8)) {
((start & 0xfeef) != 0x02e8)) if (!request_region(start, stop-start+1, "i82365"))
return 1; return 1;
else release_region(start, stop-start+1);
return 0; }
return 0;
} }
/*====================================================================*/ /*====================================================================*/
...@@ -696,7 +698,13 @@ static void __init add_pcic(int ns, int type) ...@@ -696,7 +698,13 @@ static void __init add_pcic(int ns, int type)
struct i82365_socket *t = &socket[sockets-ns]; struct i82365_socket *t = &socket[sockets-ns];
base = 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"); if (base == 0) printk("\n");
printk(KERN_INFO " %s", pcic[type].name); printk(KERN_INFO " %s", pcic[type].name);
...@@ -803,7 +811,7 @@ static void __init isa_probe(void) ...@@ -803,7 +811,7 @@ static void __init isa_probe(void)
} }
#endif #endif
if (check_region(i365_base, 2) != 0) { if (!request_region(i365_base, 2, "i82365")) {
if (sockets == 0) if (sockets == 0)
printk("port conflict at %#lx\n", i365_base); printk("port conflict at %#lx\n", i365_base);
return; return;
...@@ -1441,6 +1449,7 @@ static void __exit exit_i82365(void) ...@@ -1441,6 +1449,7 @@ static void __exit exit_i82365(void)
i365_set(i, I365_CSCINT, 0); i365_set(i, I365_CSCINT, 0);
release_region(socket[i].ioaddr, 2); release_region(socket[i].ioaddr, 2);
} }
release_region(i365_base, 2);
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
if (i82365_pnpdev) if (i82365_pnpdev)
pnp_disable_dev(i82365_pnpdev); pnp_disable_dev(i82365_pnpdev);
......
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