Lines Matching refs:dev_res
44 struct pci_dev_resource *dev_res, *tmp; in free_list() local
46 list_for_each_entry_safe(dev_res, tmp, head, list) { in free_list()
47 list_del(&dev_res->list); in free_list()
48 kfree(dev_res); in free_list()
85 struct pci_dev_resource *dev_res, *tmp; in remove_from_list() local
87 list_for_each_entry_safe(dev_res, tmp, head, list) { in remove_from_list()
88 if (dev_res->res == res) { in remove_from_list()
89 list_del(&dev_res->list); in remove_from_list()
90 kfree(dev_res); in remove_from_list()
99 struct pci_dev_resource *dev_res; in res_to_dev_res() local
101 list_for_each_entry(dev_res, head, list) { in res_to_dev_res()
102 if (dev_res->res == res) in res_to_dev_res()
103 return dev_res; in res_to_dev_res()
112 struct pci_dev_resource *dev_res; in get_res_add_size() local
114 dev_res = res_to_dev_res(head, res); in get_res_add_size()
115 return dev_res ? dev_res->add_size : 0; in get_res_add_size()
121 struct pci_dev_resource *dev_res; in get_res_add_align() local
123 dev_res = res_to_dev_res(head, res); in get_res_add_align()
124 return dev_res ? dev_res->min_align : 0; in get_res_add_align()
134 struct pci_dev_resource *dev_res, *tmp; in pdev_sort_resources() local
159 list_for_each_entry(dev_res, head, list) { in pdev_sort_resources()
162 align = pci_resource_alignment(dev_res->dev, in pdev_sort_resources()
163 dev_res->res); in pdev_sort_resources()
166 n = &dev_res->list; in pdev_sort_resources()
217 struct pci_dev_resource *dev_res; in reassign_resources_sorted() local
230 list_for_each_entry(dev_res, head, list) { in reassign_resources_sorted()
231 if (dev_res->res == res) { in reassign_resources_sorted()
276 struct pci_dev_resource *dev_res; in assign_requested_resources_sorted() local
279 list_for_each_entry(dev_res, head, list) { in assign_requested_resources_sorted()
280 res = dev_res->res; in assign_requested_resources_sorted()
281 idx = res - &dev_res->dev->resource[0]; in assign_requested_resources_sorted()
283 pci_assign_resource(dev_res->dev, idx)) { in assign_requested_resources_sorted()
293 dev_res->dev, res, in assign_requested_resources_sorted()
370 struct pci_dev_resource *dev_res, *tmp_res, *dev_res2; in __assign_resources_sorted() local
379 list_for_each_entry(dev_res, head, list) { in __assign_resources_sorted()
380 if (add_to_list(&save_head, dev_res->dev, dev_res->res, 0, 0)) { in __assign_resources_sorted()
387 list_for_each_entry_safe(dev_res, tmp_res, head, list) { in __assign_resources_sorted()
388 dev_res->res->end += get_res_add_size(realloc_head, in __assign_resources_sorted()
389 dev_res->res); in __assign_resources_sorted()
397 if (!(dev_res->res->flags & IORESOURCE_STARTALIGN)) in __assign_resources_sorted()
400 add_align = get_res_add_align(realloc_head, dev_res->res); in __assign_resources_sorted()
409 if (add_align > dev_res->res->start) { in __assign_resources_sorted()
410 resource_size_t r_size = resource_size(dev_res->res); in __assign_resources_sorted()
412 dev_res->res->start = add_align; in __assign_resources_sorted()
413 dev_res->res->end = add_align + r_size - 1; in __assign_resources_sorted()
419 list_move_tail(&dev_res->list, in __assign_resources_sorted()
434 list_for_each_entry(dev_res, head, list) in __assign_resources_sorted()
435 remove_from_list(realloc_head, dev_res->res); in __assign_resources_sorted()
444 list_for_each_entry_safe(dev_res, tmp_res, head, list) in __assign_resources_sorted()
445 if (dev_res->res->parent && in __assign_resources_sorted()
446 !pci_need_to_release(fail_type, dev_res->res)) { in __assign_resources_sorted()
448 remove_from_list(realloc_head, dev_res->res); in __assign_resources_sorted()
449 remove_from_list(&save_head, dev_res->res); in __assign_resources_sorted()
450 list_del(&dev_res->list); in __assign_resources_sorted()
451 kfree(dev_res); in __assign_resources_sorted()
456 list_for_each_entry(dev_res, head, list) in __assign_resources_sorted()
457 if (dev_res->res->parent) in __assign_resources_sorted()
458 release_resource(dev_res->res); in __assign_resources_sorted()
2219 struct pci_dev_resource *dev_res; in pci_reassign_bridge_resources() local
2277 list_for_each_entry(dev_res, &saved, list) { in pci_reassign_bridge_resources()
2279 if (bridge == dev_res->dev) in pci_reassign_bridge_resources()
2282 bridge = dev_res->dev; in pci_reassign_bridge_resources()
2292 list_for_each_entry(dev_res, &failed, list) { in pci_reassign_bridge_resources()
2293 struct resource *res = dev_res->res; in pci_reassign_bridge_resources()
2295 res->start = dev_res->start; in pci_reassign_bridge_resources()
2296 res->end = dev_res->end; in pci_reassign_bridge_resources()
2297 res->flags = dev_res->flags; in pci_reassign_bridge_resources()
2302 list_for_each_entry(dev_res, &saved, list) { in pci_reassign_bridge_resources()
2303 struct resource *res = dev_res->res; in pci_reassign_bridge_resources()
2305 bridge = dev_res->dev; in pci_reassign_bridge_resources()
2308 res->start = dev_res->start; in pci_reassign_bridge_resources()
2309 res->end = dev_res->end; in pci_reassign_bridge_resources()
2310 res->flags = dev_res->flags; in pci_reassign_bridge_resources()