• Home
  • Raw
  • Download

Lines Matching refs:new

171 static struct resource * __request_resource(struct resource *root, struct resource *new)  in __request_resource()  argument
173 resource_size_t start = new->start; in __request_resource()
174 resource_size_t end = new->end; in __request_resource()
187 new->sibling = tmp; in __request_resource()
188 *p = new; 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()
580 struct resource *new, in __find_resource() argument
585 struct resource tmp = *new, avail, alloc; in __find_resource()
611 avail.flags = new->flags & ~IORESOURCE_UNSET; in __find_resource()
619 new->start = alloc.start; in __find_resource()
620 new->end = alloc.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()
660 struct resource new = *old; in reallocate_resource() local
665 if ((err = __find_resource(root, old, &new, newsize, constraint))) in reallocate_resource()
668 if (resource_contains(&new, old)) { in reallocate_resource()
669 old->start = new.start; in reallocate_resource()
670 old->end = new.end; in reallocate_resource()
679 if (resource_contains(old, &new)) { in reallocate_resource()
680 old->start = new.start; in reallocate_resource()
681 old->end = new.end; in reallocate_resource()
684 *old = new; in reallocate_resource()
706 int allocate_resource(struct resource *root, struct resource *new, in allocate_resource() argument
727 if ( new->parent ) { in allocate_resource()
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()
768 static struct resource * __insert_resource(struct resource *parent, struct resource *new) in __insert_resource() argument
773 first = __request_resource(parent, new); in __insert_resource()
779 if (WARN_ON(first == new)) /* duplicated insertion */ in __insert_resource()
782 if ((first->start > new->start) || (first->end < new->end)) in __insert_resource()
784 if ((first->start == new->start) && (first->end == new->end)) in __insert_resource()
790 if (next->start < new->start || next->end > new->end) in __insert_resource()
794 if (next->sibling->start > new->end) in __insert_resource()
798 new->parent = parent; in __insert_resource()
799 new->sibling = next->sibling; in __insert_resource()
800 new->child = first; in __insert_resource()
804 next->parent = new; in __insert_resource()
807 parent->child = new; in __insert_resource()
812 next->sibling = new; in __insert_resource()
833 struct resource *insert_resource_conflict(struct resource *parent, struct resource *new) in insert_resource_conflict() argument
838 conflict = __insert_resource(parent, new); in insert_resource_conflict()
853 int insert_resource(struct resource *parent, struct resource *new) in insert_resource() argument
857 conflict = insert_resource_conflict(parent, new); in insert_resource()
870 void insert_resource_expand_to_fit(struct resource *root, struct resource *new) in insert_resource_expand_to_fit() argument
872 if (new->parent) in insert_resource_expand_to_fit()
879 conflict = __insert_resource(root, new); in insert_resource_expand_to_fit()
886 if (conflict->start < new->start) in insert_resource_expand_to_fit()
887 new->start = conflict->start; in insert_resource_expand_to_fit()
888 if (conflict->end > new->end) in insert_resource_expand_to_fit()
889 new->end = conflict->end; in insert_resource_expand_to_fit()
891 printk("Expanded resource %s due to conflict with %s\n", new->name, conflict->name); in insert_resource_expand_to_fit()
1492 struct resource *new) in devm_request_resource() argument
1500 *ptr = new; in devm_request_resource()
1502 conflict = request_resource_conflict(root, new); in devm_request_resource()
1505 new, conflict->name, conflict); in devm_request_resource()
1529 void devm_release_resource(struct device *dev, struct resource *new) in devm_release_resource() argument
1532 new)); in devm_release_resource()