MCPcopy Create free account
hub / github.com/F-Stack/f-stack / apb_add_child

Function apb_add_child

freebsd/mips/atheros/apb.c:448–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448static device_t
449apb_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

Callers

nothing calls this directly

Calls 5

mallocFunction · 0.85
resource_list_initFunction · 0.85
device_add_child_orderedFunction · 0.85
device_set_ivarsFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected