Lines Matching refs:new
185 static struct resource * __request_resource(struct resource *root, struct resource *new) in __request_resource() argument
187 resource_size_t start = new->start; in __request_resource()
188 resource_size_t end = new->end; in __request_resource()
201 new->sibling = tmp; in __request_resource()
202 *p = new; in __request_resource()
203 new->parent = root; in __request_resource()
279 struct resource *request_resource_conflict(struct resource *root, struct resource *new) in request_resource_conflict() argument
284 conflict = __request_resource(root, new); in request_resource_conflict()
296 int request_resource(struct resource *root, struct resource *new) in request_resource() argument
300 conflict = request_resource_conflict(root, new); in request_resource()
593 struct resource *new, in __find_resource() argument
598 struct resource tmp = *new, avail, alloc; in __find_resource()
624 avail.flags = new->flags & ~IORESOURCE_UNSET; in __find_resource()
632 new->start = alloc.start; in __find_resource()
633 new->end = alloc.end; in __find_resource()
651 static int find_resource(struct resource *root, struct resource *new, in find_resource() argument
655 return __find_resource(root, NULL, new, size, constraint); in find_resource()
673 struct resource new = *old; in reallocate_resource() local
678 if ((err = __find_resource(root, old, &new, newsize, constraint))) in reallocate_resource()
681 if (resource_contains(&new, old)) { in reallocate_resource()
682 old->start = new.start; in reallocate_resource()
683 old->end = new.end; in reallocate_resource()
692 if (resource_contains(old, &new)) { in reallocate_resource()
693 old->start = new.start; in reallocate_resource()
694 old->end = new.end; in reallocate_resource()
697 *old = new; in reallocate_resource()
719 int allocate_resource(struct resource *root, struct resource *new, in allocate_resource() argument
740 if ( new->parent ) { in allocate_resource()
743 return reallocate_resource(root, new, size, &constraint); in allocate_resource()
747 err = find_resource(root, new, size, &constraint); in allocate_resource()
748 if (err >= 0 && __request_resource(root, new)) in allocate_resource()
781 static struct resource * __insert_resource(struct resource *parent, struct resource *new) in __insert_resource() argument
786 first = __request_resource(parent, new); in __insert_resource()
792 if (WARN_ON(first == new)) /* duplicated insertion */ in __insert_resource()
795 if ((first->start > new->start) || (first->end < new->end)) in __insert_resource()
797 if ((first->start == new->start) && (first->end == new->end)) in __insert_resource()
803 if (next->start < new->start || next->end > new->end) in __insert_resource()
807 if (next->sibling->start > new->end) in __insert_resource()
811 new->parent = parent; in __insert_resource()
812 new->sibling = next->sibling; in __insert_resource()
813 new->child = first; in __insert_resource()
817 next->parent = new; in __insert_resource()
820 parent->child = new; in __insert_resource()
825 next->sibling = new; in __insert_resource()
846 struct resource *insert_resource_conflict(struct resource *parent, struct resource *new) in insert_resource_conflict() argument
851 conflict = __insert_resource(parent, new); in insert_resource_conflict()
866 int insert_resource(struct resource *parent, struct resource *new) in insert_resource() argument
870 conflict = insert_resource_conflict(parent, new); in insert_resource()
883 void insert_resource_expand_to_fit(struct resource *root, struct resource *new) in insert_resource_expand_to_fit() argument
885 if (new->parent) in insert_resource_expand_to_fit()
892 conflict = __insert_resource(root, new); in insert_resource_expand_to_fit()
899 if (conflict->start < new->start) in insert_resource_expand_to_fit()
900 new->start = conflict->start; in insert_resource_expand_to_fit()
901 if (conflict->end > new->end) in insert_resource_expand_to_fit()
902 new->end = conflict->end; in insert_resource_expand_to_fit()
904 printk("Expanded resource %s due to conflict with %s\n", new->name, conflict->name); in insert_resource_expand_to_fit()
1380 struct resource *new) in devm_request_resource() argument
1388 *ptr = new; in devm_request_resource()
1390 conflict = request_resource_conflict(root, new); in devm_request_resource()
1393 new, conflict->name, conflict); in devm_request_resource()
1417 void devm_release_resource(struct device *dev, struct resource *new) in devm_release_resource() argument
1420 new)); in devm_release_resource()