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()
557 struct resource *new, in __find_resource() argument
562 struct resource tmp = *new, avail, alloc; in __find_resource()
588 avail.flags = new->flags & ~IORESOURCE_UNSET; in __find_resource()
595 new->start = alloc.start; in __find_resource()
596 new->end = alloc.end; in __find_resource()
614 static int find_resource(struct resource *root, struct resource *new, in find_resource() argument
618 return __find_resource(root, NULL, new, size, constraint); in find_resource()
636 struct resource new = *old; in reallocate_resource() local
641 if ((err = __find_resource(root, old, &new, newsize, constraint))) in reallocate_resource()
644 if (resource_contains(&new, old)) { in reallocate_resource()
645 old->start = new.start; in reallocate_resource()
646 old->end = new.end; in reallocate_resource()
655 if (resource_contains(old, &new)) { in reallocate_resource()
656 old->start = new.start; in reallocate_resource()
657 old->end = new.end; in reallocate_resource()
660 *old = new; in reallocate_resource()
682 int allocate_resource(struct resource *root, struct resource *new, in allocate_resource() argument
703 if ( new->parent ) { in allocate_resource()
706 return reallocate_resource(root, new, size, &constraint); in allocate_resource()
710 err = find_resource(root, new, size, &constraint); in allocate_resource()
711 if (err >= 0 && __request_resource(root, new)) in allocate_resource()
744 static struct resource * __insert_resource(struct resource *parent, struct resource *new) in __insert_resource() argument
749 first = __request_resource(parent, new); in __insert_resource()
755 if (WARN_ON(first == new)) /* duplicated insertion */ in __insert_resource()
758 if ((first->start > new->start) || (first->end < new->end)) in __insert_resource()
760 if ((first->start == new->start) && (first->end == new->end)) in __insert_resource()
766 if (next->start < new->start || next->end > new->end) in __insert_resource()
770 if (next->sibling->start > new->end) in __insert_resource()
774 new->parent = parent; in __insert_resource()
775 new->sibling = next->sibling; in __insert_resource()
776 new->child = first; in __insert_resource()
780 next->parent = new; in __insert_resource()
783 parent->child = new; in __insert_resource()
788 next->sibling = new; in __insert_resource()
806 struct resource *insert_resource_conflict(struct resource *parent, struct resource *new) in insert_resource_conflict() argument
811 conflict = __insert_resource(parent, new); in insert_resource_conflict()
823 int insert_resource(struct resource *parent, struct resource *new) in insert_resource() argument
827 conflict = insert_resource_conflict(parent, new); in insert_resource()
839 void insert_resource_expand_to_fit(struct resource *root, struct resource *new) in insert_resource_expand_to_fit() argument
841 if (new->parent) in insert_resource_expand_to_fit()
848 conflict = __insert_resource(root, new); in insert_resource_expand_to_fit()
855 if (conflict->start < new->start) in insert_resource_expand_to_fit()
856 new->start = conflict->start; in insert_resource_expand_to_fit()
857 if (conflict->end > new->end) in insert_resource_expand_to_fit()
858 new->end = conflict->end; in insert_resource_expand_to_fit()
860 printk("Expanded resource %s due to conflict with %s\n", new->name, conflict->name); in insert_resource_expand_to_fit()
1280 struct resource *new) in devm_request_resource() argument
1288 *ptr = new; in devm_request_resource()
1290 conflict = request_resource_conflict(root, new); in devm_request_resource()
1293 new, conflict->name, conflict); in devm_request_resource()
1317 void devm_release_resource(struct device *dev, struct resource *new) in devm_release_resource() argument
1320 new)); in devm_release_resource()