Lines Matching refs:new
181 static struct resource * __request_resource(struct resource *root, struct resource *new) in __request_resource() argument
183 resource_size_t start = new->start; in __request_resource()
184 resource_size_t end = new->end; in __request_resource()
197 new->sibling = tmp; in __request_resource()
198 *p = new; in __request_resource()
199 new->parent = root; in __request_resource()
275 struct resource *request_resource_conflict(struct resource *root, struct resource *new) in request_resource_conflict() argument
280 conflict = __request_resource(root, new); in request_resource_conflict()
292 int request_resource(struct resource *root, struct resource *new) in request_resource() argument
296 conflict = request_resource_conflict(root, new); in request_resource()
669 struct resource *new, resource_size_t size, in __find_resource_space() argument
673 struct resource tmp = *new, avail, alloc; in __find_resource_space()
700 avail.flags = new->flags & ~IORESOURCE_UNSET; in __find_resource_space()
712 new->start = alloc.start; in __find_resource_space()
713 new->end = alloc.end; in __find_resource_space()
742 int find_resource_space(struct resource *root, struct resource *new, in find_resource_space() argument
746 return __find_resource_space(root, NULL, new, size, constraint); in find_resource_space()
765 struct resource new = *old; in reallocate_resource() local
770 if ((err = __find_resource_space(root, old, &new, newsize, constraint))) in reallocate_resource()
773 if (resource_contains(&new, old)) { in reallocate_resource()
774 old->start = new.start; in reallocate_resource()
775 old->end = new.end; in reallocate_resource()
784 if (resource_contains(old, &new)) { in reallocate_resource()
785 old->start = new.start; in reallocate_resource()
786 old->end = new.end; in reallocate_resource()
789 *old = new; in reallocate_resource()
811 int allocate_resource(struct resource *root, struct resource *new, in allocate_resource() argument
826 if ( new->parent ) { in allocate_resource()
829 return reallocate_resource(root, new, size, &constraint); in allocate_resource()
833 err = find_resource_space(root, new, size, &constraint); in allocate_resource()
834 if (err >= 0 && __request_resource(root, new)) in allocate_resource()
867 static struct resource * __insert_resource(struct resource *parent, struct resource *new) in __insert_resource() argument
872 first = __request_resource(parent, new); in __insert_resource()
878 if (WARN_ON(first == new)) /* duplicated insertion */ in __insert_resource()
881 if ((first->start > new->start) || (first->end < new->end)) in __insert_resource()
883 if ((first->start == new->start) && (first->end == new->end)) in __insert_resource()
889 if (next->start < new->start || next->end > new->end) in __insert_resource()
893 if (next->sibling->start > new->end) in __insert_resource()
897 new->parent = parent; in __insert_resource()
898 new->sibling = next->sibling; in __insert_resource()
899 new->child = first; in __insert_resource()
903 next->parent = new; in __insert_resource()
906 parent->child = new; in __insert_resource()
911 next->sibling = new; in __insert_resource()
932 struct resource *insert_resource_conflict(struct resource *parent, struct resource *new) in insert_resource_conflict() argument
937 conflict = __insert_resource(parent, new); in insert_resource_conflict()
952 int insert_resource(struct resource *parent, struct resource *new) in insert_resource() argument
956 conflict = insert_resource_conflict(parent, new); in insert_resource()
969 void insert_resource_expand_to_fit(struct resource *root, struct resource *new) in insert_resource_expand_to_fit() argument
971 if (new->parent) in insert_resource_expand_to_fit()
978 conflict = __insert_resource(root, new); in insert_resource_expand_to_fit()
985 if (conflict->start < new->start) in insert_resource_expand_to_fit()
986 new->start = conflict->start; in insert_resource_expand_to_fit()
987 if (conflict->end > new->end) in insert_resource_expand_to_fit()
988 new->end = conflict->end; in insert_resource_expand_to_fit()
990 pr_info("Expanded resource %s due to conflict with %s\n", new->name, conflict->name); in insert_resource_expand_to_fit()
1590 struct resource *new) in devm_request_resource() argument
1598 *ptr = new; in devm_request_resource()
1600 conflict = request_resource_conflict(root, new); in devm_request_resource()
1603 new, conflict->name, conflict); in devm_request_resource()
1627 void devm_release_resource(struct device *dev, struct resource *new) in devm_release_resource() argument
1630 new)); in devm_release_resource()