[PATCH] 2.6.13 - 3/3 - Remove the deprecated function __check_region

From: Stephane Wirtel
Date: Tue Aug 30 2005 - 12:08:59 EST


Hi all,

Here is the first patch for kernel 2.6.13 from Linus tree.


--
Stephane Wirtel <stephane.wirtel@xxxxxxxxxxxx>
<stephane.wirtel@xxxxxxxxx>


diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -242,6 +242,7 @@ int pnp_check_port(struct pnp_dev * dev,
int tmp;
struct pnp_dev *tdev;
unsigned long *port, *end, *tport, *tend;
+ struct resource *res = 0;
port = &dev->res.port_resource[idx].start;
end = &dev->res.port_resource[idx].end;

@@ -252,8 +253,12 @@ int pnp_check_port(struct pnp_dev * dev,
/* check if the resource is already in use, skip if the
* device is active because it itself may be in use */
if(!dev->active) {
- if (__check_region(&ioport_resource, *port, length(port,end)))
+ res = __request_region(&ioport_resource, *port, length(port,end), "check-region");
+ if (res) {
+ release_resource (res);
+ kfree (res);
return 0;
+ }
}

/* check if the resource is reserved */
@@ -298,6 +303,7 @@ int pnp_check_mem(struct pnp_dev * dev,
int tmp;
struct pnp_dev *tdev;
unsigned long *addr, *end, *taddr, *tend;
+ struct resource *res = 0;
addr = &dev->res.mem_resource[idx].start;
end = &dev->res.mem_resource[idx].end;

@@ -308,8 +314,12 @@ int pnp_check_mem(struct pnp_dev * dev,
/* check if the resource is already in use, skip if the
* device is active because it itself may be in use */
if(!dev->active) {
- if (check_mem_region(*addr, length(addr,end)))
+ res == __request_region(&iomem_resource, *addr, length(addr, end), "check-region");
+ if (res) {
+ release_resource (res);
+ kfree (res);
return 0;
+ }
}

/* check if the resource is reserved */