Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261846
b: refs/heads/master
c: 1c38891
h: refs/heads/master
v: v3
  • Loading branch information
Geert Uytterhoeven committed Jul 30, 2011
1 parent 4bd41bf commit 898077a
Show file tree
Hide file tree
Showing 3 changed files with 23 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: 88efd0bbc0fe403a9948e6f94cc48b9f15ee4861
refs/heads/master: 1c388919d89ca35741e9c4d3255adf87f76f0c06
1 change: 1 addition & 0 deletions trunk/include/linux/ioport.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ extern int allocate_resource(struct resource *root, struct resource *new,
resource_size_t,
resource_size_t),
void *alignf_data);
struct resource *lookup_resource(struct resource *root, resource_size_t start);
int adjust_resource(struct resource *res, resource_size_t start,
resource_size_t size);
resource_size_t resource_alignment(struct resource *res);
Expand Down
21 changes: 21 additions & 0 deletions trunk/kernel/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,27 @@ int allocate_resource(struct resource *root, struct resource *new,

EXPORT_SYMBOL(allocate_resource);

/**
* lookup_resource - find an existing resource by a resource start address
* @root: root resource descriptor
* @start: resource start address
*
* Returns a pointer to the resource if found, NULL otherwise
*/
struct resource *lookup_resource(struct resource *root, resource_size_t start)
{
struct resource *res;

read_lock(&resource_lock);
for (res = root->child; res; res = res->sibling) {
if (res->start == start)
break;
}
read_unlock(&resource_lock);

return res;
}

/*
* Insert a resource into the resource tree. If successful, return NULL,
* otherwise return the conflicting resource (compare to __request_resource())
Expand Down

0 comments on commit 898077a

Please sign in to comment.