| 446 | } |
| 447 | |
| 448 | static device_t |
| 449 | apb_add_child(device_t bus, u_int order, const char *name, int unit) |
| 450 | { |
| 451 | device_t child; |
| 452 | struct apb_ivar *ivar; |
| 453 | |
| 454 | ivar = malloc(sizeof(struct apb_ivar), M_DEVBUF, M_WAITOK | M_ZERO); |
| 455 | resource_list_init(&ivar->resources); |
| 456 | |
| 457 | child = device_add_child_ordered(bus, order, name, unit); |
| 458 | if (child == NULL) { |
| 459 | printf("Can't add child %s%d ordered\n", name, unit); |
| 460 | return (0); |
| 461 | } |
| 462 | |
| 463 | device_set_ivars(child, ivar); |
| 464 | |
| 465 | return (child); |
| 466 | } |
| 467 | |
| 468 | /* |
| 469 | * Helper routine for bus_generic_rl_get_resource/bus_generic_rl_set_resource |
nothing calls this directly
no test coverage detected