* @brief Helper function for implementing BUS_ALLOC_RESOURCE(). * * This implementation of BUS_ALLOC_RESOURCE() uses the * resource_list_alloc() function to do most of the work. It calls * BUS_GET_RESOURCE_LIST() to find a suitable resource list. */
| 4509 | * BUS_GET_RESOURCE_LIST() to find a suitable resource list. |
| 4510 | */ |
| 4511 | struct resource * |
| 4512 | bus_generic_rl_alloc_resource(device_t dev, device_t child, int type, |
| 4513 | int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) |
| 4514 | { |
| 4515 | struct resource_list * rl = NULL; |
| 4516 | |
| 4517 | if (device_get_parent(child) != dev) |
| 4518 | return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, |
| 4519 | type, rid, start, end, count, flags)); |
| 4520 | |
| 4521 | rl = BUS_GET_RESOURCE_LIST(dev, child); |
| 4522 | if (!rl) |
| 4523 | return (NULL); |
| 4524 | |
| 4525 | return (resource_list_alloc(rl, dev, child, type, rid, |
| 4526 | start, end, count, flags)); |
| 4527 | } |
| 4528 | |
| 4529 | /** |
| 4530 | * @brief Helper function for implementing BUS_CHILD_PRESENT(). |
nothing calls this directly
no test coverage detected