Lines Matching refs:root
106 struct resource *root = m->private; in r_show() local
108 int width = root->end < 0x10000 ? 4 : 8; in r_show()
112 if (p->parent == root) in r_show()
208 static struct resource * __request_resource(struct resource *root, struct resource *new) in __request_resource() argument
215 return root; in __request_resource()
216 if (start < root->start) in __request_resource()
217 return root; in __request_resource()
218 if (end > root->end) in __request_resource()
219 return root; in __request_resource()
220 p = &root->child; in __request_resource()
226 new->parent = root; in __request_resource()
292 struct resource *request_resource_conflict(struct resource *root, struct resource *new) in request_resource_conflict() argument
297 conflict = __request_resource(root, new); in request_resource_conflict()
309 int request_resource(struct resource *root, struct resource *new) in request_resource() argument
313 conflict = request_resource_conflict(root, new); in request_resource()
567 static int __find_resource(struct resource *root, struct resource *old, in __find_resource() argument
572 struct resource *this = root->child; in __find_resource()
575 tmp.start = root->start; in __find_resource()
580 if (this && this->start == root->start) { in __find_resource()
588 tmp.end = root->end; in __find_resource()
612 next: if (!this || this->end == root->end) in __find_resource()
625 static int find_resource(struct resource *root, struct resource *new, in find_resource() argument
629 return __find_resource(root, NULL, new, size, constraint); in find_resource()
642 static int reallocate_resource(struct resource *root, struct resource *old, in reallocate_resource() argument
652 if ((err = __find_resource(root, old, &new, newsize, constraint))) in reallocate_resource()
672 conflict = __request_resource(root, old); in reallocate_resource()
693 int allocate_resource(struct resource *root, struct resource *new, in allocate_resource() argument
717 return reallocate_resource(root, new, size, &constraint); in allocate_resource()
721 err = find_resource(root, new, size, &constraint); in allocate_resource()
722 if (err >= 0 && __request_resource(root, new)) in allocate_resource()
737 struct resource *lookup_resource(struct resource *root, resource_size_t start) in lookup_resource() argument
742 for (res = root->child; res; res = res->sibling) { in lookup_resource()
850 void insert_resource_expand_to_fit(struct resource *root, struct resource *new) in insert_resource_expand_to_fit() argument
859 conflict = __insert_resource(root, new); in insert_resource_expand_to_fit()
862 if (conflict == root) in insert_resource_expand_to_fit()
935 static void __init __reserve_region_with_split(struct resource *root, in __reserve_region_with_split() argument
939 struct resource *parent = root; in __reserve_region_with_split()
993 void __init reserve_region_with_split(struct resource *root, in reserve_region_with_split() argument
1000 if (root->start > start || root->end < end) { in reserve_region_with_split()
1003 root); in reserve_region_with_split()
1004 if (start > root->end || end < root->start) in reserve_region_with_split()
1007 if (end > root->end) in reserve_region_with_split()
1008 end = root->end; in reserve_region_with_split()
1009 if (start < root->start) in reserve_region_with_split()
1010 start = root->start; in reserve_region_with_split()
1018 __reserve_region_with_split(root, start, end, name); in reserve_region_with_split()
1290 int devm_request_resource(struct device *dev, struct resource *root, in devm_request_resource() argument
1301 conflict = request_resource_conflict(root, new); in devm_request_resource()