Skip to contentSkip to conversation

2.6.13 - 3/3 - Remove the deprecated function __check_region

PATCH In review Stephane Wirtel 1 participant 2 messages Aug 30, 2005 Pnp support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.6.13 - 3/3 - Remove the deprecated function __check_region

Hi all,

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

Signature · 2 lines
Stephane Wirtel <[email protected]>
                <[email protected]>
drivers/pnp/resource.c +12 -2
@@ -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 */