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

Function device_delete_children

freebsd/kern/subr_bus.c:1981–1999  ·  view source on GitHub ↗

* @brief Delete all children devices of the given device, if any. * * This function deletes all children devices of the given device, if * any, using the device_delete_child() function for each device it * finds. If a child device cannot be deleted, this function will * return an error code. * * @param dev the parent device * * @retval 0 success * @retval non-zero a device would not de

Source from the content-addressed store, hash-verified

1979 * @retval non-zero a device would not detach
1980 */
1981int
1982device_delete_children(device_t dev)
1983{
1984 device_t child;
1985 int error;
1986
1987 PDEBUG(("Deleting all children of %s", DEVICENAME(dev)));
1988
1989 error = 0;
1990
1991 while ((child = TAILQ_FIRST(&dev->children)) != NULL) {
1992 error = device_delete_child(dev, child);
1993 if (error) {
1994 PDEBUG(("Failed deleting %s", DEVICENAME(child)));
1995 break;
1996 }
1997 }
1998 return (error);
1999}
2000
2001/**
2002 * @brief Find a device given a unit number

Callers 15

jz4780_ehci_detachFunction · 0.85
jz4780_ohci_detachFunction · 0.85
ar71xx_ohci_detachFunction · 0.85
ar71xx_ehci_detachFunction · 0.85
octusb_octeon_detachFunction · 0.85
ohci_fdt_detachFunction · 0.85
ehci_fdt_detachFunction · 0.85
dotg_fdt_detachFunction · 0.85
mtk_xhci_fdt_detachFunction · 0.85
bcma_nexus_attachFunction · 0.85
cpsw_detachFunction · 0.85
omap_ehci_detachFunction · 0.85

Calls 1

device_delete_childFunction · 0.85

Tested by

no test coverage detected