Lines Matching refs:root
110 struct resource *root = pde_data(file_inode(m->file)); in r_show() local
113 int width = root->end < 0x10000 ? 4 : 8; in r_show()
117 if (p->parent == root) in r_show()
171 static struct resource * __request_resource(struct resource *root, struct resource *new) in __request_resource() argument
178 return root; in __request_resource()
179 if (start < root->start) in __request_resource()
180 return root; in __request_resource()
181 if (end > root->end) in __request_resource()
182 return root; in __request_resource()
183 p = &root->child; in __request_resource()
189 new->parent = root; in __request_resource()
265 struct resource *request_resource_conflict(struct resource *root, struct resource *new) in request_resource_conflict() argument
270 conflict = __request_resource(root, new); in request_resource_conflict()
282 int request_resource(struct resource *root, struct resource *new) in request_resource() argument
286 conflict = request_resource_conflict(root, new); in request_resource()
579 static int __find_resource(struct resource *root, struct resource *old, in __find_resource() argument
584 struct resource *this = root->child; in __find_resource()
587 tmp.start = root->start; in __find_resource()
592 if (this && this->start == root->start) { in __find_resource()
600 tmp.end = root->end; in __find_resource()
625 next: if (!this || this->end == root->end) in __find_resource()
638 static int find_resource(struct resource *root, struct resource *new, in find_resource() argument
642 return __find_resource(root, NULL, new, size, constraint); in find_resource()
655 static int reallocate_resource(struct resource *root, struct resource *old, in reallocate_resource() argument
665 if ((err = __find_resource(root, old, &new, newsize, constraint))) in reallocate_resource()
685 conflict = __request_resource(root, old); in reallocate_resource()
706 int allocate_resource(struct resource *root, struct resource *new, in allocate_resource() argument
730 return reallocate_resource(root, new, size, &constraint); in allocate_resource()
734 err = find_resource(root, new, size, &constraint); in allocate_resource()
735 if (err >= 0 && __request_resource(root, new)) in allocate_resource()
750 struct resource *lookup_resource(struct resource *root, resource_size_t start) in lookup_resource() argument
755 for (res = root->child; res; res = res->sibling) { in lookup_resource()
870 void insert_resource_expand_to_fit(struct resource *root, struct resource *new) in insert_resource_expand_to_fit() argument
879 conflict = __insert_resource(root, new); in insert_resource_expand_to_fit()
882 if (conflict == root) in insert_resource_expand_to_fit()
989 __reserve_region_with_split(struct resource *root, resource_size_t start, in __reserve_region_with_split() argument
992 struct resource *parent = root; in __reserve_region_with_split()
996 int type = resource_type(root); in __reserve_region_with_split()
1050 reserve_region_with_split(struct resource *root, resource_size_t start, in reserve_region_with_split() argument
1056 if (root->start > start || root->end < end) { in reserve_region_with_split()
1059 root); in reserve_region_with_split()
1060 if (start > root->end || end < root->start) in reserve_region_with_split()
1063 if (end > root->end) in reserve_region_with_split()
1064 end = root->end; in reserve_region_with_split()
1065 if (start < root->start) in reserve_region_with_split()
1066 start = root->start; in reserve_region_with_split()
1074 __reserve_region_with_split(root, start, end, name); in reserve_region_with_split()
1491 int devm_request_resource(struct device *dev, struct resource *root, in devm_request_resource() argument
1502 conflict = request_resource_conflict(root, new); in devm_request_resource()