Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180967
b: refs/heads/master
c: 5eeec0e
h: refs/heads/master
i:
  180965: 0db8a8d
  180963: d5d1fa5
  180959: baed09b
v: v3
  • Loading branch information
Yinghai Lu authored and Jesse Barnes committed Feb 23, 2010
1 parent 6b99a9b commit 87b0b99
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7cc5997d1dada3bdeed95a59c2f4f6c66cbb0767
refs/heads/master: 5eeec0ec931a01e85b3701ce121b7d8a1800ec60
1 change: 1 addition & 0 deletions trunk/include/linux/ioport.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ extern struct resource iomem_resource;

extern int request_resource(struct resource *root, struct resource *new);
extern int release_resource(struct resource *new);
void release_child_resources(struct resource *new);
extern void reserve_region_with_split(struct resource *root,
resource_size_t start, resource_size_t end,
const char *name);
Expand Down
30 changes: 30 additions & 0 deletions trunk/kernel/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,36 @@ static int __release_resource(struct resource *old)
return -EINVAL;
}

static void __release_child_resources(struct resource *r)
{
struct resource *tmp, *p;
resource_size_t size;

p = r->child;
r->child = NULL;
while (p) {
tmp = p;
p = p->sibling;

tmp->parent = NULL;
tmp->sibling = NULL;
__release_child_resources(tmp);

printk(KERN_DEBUG "release child resource %pR\n", tmp);
/* need to restore size, and keep flags */
size = resource_size(tmp);
tmp->start = 0;
tmp->end = size - 1;
}
}

void release_child_resources(struct resource *r)
{
write_lock(&resource_lock);
__release_child_resources(r);
write_unlock(&resource_lock);
}

/**
* request_resource - request and reserve an I/O or memory resource
* @root: root resource descriptor
Expand Down

0 comments on commit 87b0b99

Please sign in to comment.