Lines Matching refs:new

208 static struct resource * __request_resource(struct resource *root, struct resource *new)  in __request_resource()  argument
210 resource_size_t start = new->start; in __request_resource()
211 resource_size_t end = new->end; in __request_resource()
224 new->sibling = tmp; in __request_resource()
225 *p = new; 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()
568 struct resource *new, in __find_resource() argument
573 struct resource tmp = *new, avail, alloc; in __find_resource()
599 avail.flags = new->flags & ~IORESOURCE_UNSET; in __find_resource()
606 new->start = alloc.start; in __find_resource()
607 new->end = alloc.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()
647 struct resource new = *old; in reallocate_resource() local
652 if ((err = __find_resource(root, old, &new, newsize, constraint))) in reallocate_resource()
655 if (resource_contains(&new, old)) { in reallocate_resource()
656 old->start = new.start; in reallocate_resource()
657 old->end = new.end; in reallocate_resource()
666 if (resource_contains(old, &new)) { in reallocate_resource()
667 old->start = new.start; in reallocate_resource()
668 old->end = new.end; in reallocate_resource()
671 *old = new; in reallocate_resource()
693 int allocate_resource(struct resource *root, struct resource *new, in allocate_resource() argument
714 if ( new->parent ) { in allocate_resource()
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()
755 static struct resource * __insert_resource(struct resource *parent, struct resource *new) in __insert_resource() argument
760 first = __request_resource(parent, new); in __insert_resource()
766 if (WARN_ON(first == new)) /* duplicated insertion */ in __insert_resource()
769 if ((first->start > new->start) || (first->end < new->end)) in __insert_resource()
771 if ((first->start == new->start) && (first->end == new->end)) in __insert_resource()
777 if (next->start < new->start || next->end > new->end) in __insert_resource()
781 if (next->sibling->start > new->end) in __insert_resource()
785 new->parent = parent; in __insert_resource()
786 new->sibling = next->sibling; in __insert_resource()
787 new->child = first; in __insert_resource()
791 next->parent = new; in __insert_resource()
794 parent->child = new; in __insert_resource()
799 next->sibling = new; in __insert_resource()
817 struct resource *insert_resource_conflict(struct resource *parent, struct resource *new) in insert_resource_conflict() argument
822 conflict = __insert_resource(parent, new); in insert_resource_conflict()
834 int insert_resource(struct resource *parent, struct resource *new) in insert_resource() argument
838 conflict = insert_resource_conflict(parent, new); in insert_resource()
850 void insert_resource_expand_to_fit(struct resource *root, struct resource *new) in insert_resource_expand_to_fit() argument
852 if (new->parent) in insert_resource_expand_to_fit()
859 conflict = __insert_resource(root, new); in insert_resource_expand_to_fit()
866 if (conflict->start < new->start) in insert_resource_expand_to_fit()
867 new->start = conflict->start; in insert_resource_expand_to_fit()
868 if (conflict->end > new->end) in insert_resource_expand_to_fit()
869 new->end = conflict->end; in insert_resource_expand_to_fit()
871 printk("Expanded resource %s due to conflict with %s\n", new->name, conflict->name); in insert_resource_expand_to_fit()
1291 struct resource *new) in devm_request_resource() argument
1299 *ptr = new; in devm_request_resource()
1301 conflict = request_resource_conflict(root, new); in devm_request_resource()
1304 new, conflict->name, conflict); in devm_request_resource()
1328 void devm_release_resource(struct device *dev, struct resource *new) in devm_release_resource() argument
1331 new)); in devm_release_resource()