| 195 | } |
| 196 | |
| 197 | static device_t |
| 198 | nexus_add_child(device_t bus, u_int order, const char *name, int unit) |
| 199 | { |
| 200 | device_t child; |
| 201 | struct nexus_device *ndev; |
| 202 | |
| 203 | ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT|M_ZERO); |
| 204 | if (!ndev) |
| 205 | return (0); |
| 206 | resource_list_init(&ndev->nx_resources); |
| 207 | |
| 208 | child = device_add_child_ordered(bus, order, name, unit); |
| 209 | |
| 210 | /* should we free this in nexus_child_detached? */ |
| 211 | device_set_ivars(child, ndev); |
| 212 | |
| 213 | return (child); |
| 214 | } |
| 215 | |
| 216 | /* |
| 217 | * Allocate a resource on behalf of child. NB: child is usually going to be a |
nothing calls this directly
no test coverage detected