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

Function bus_generic_detach

freebsd/kern/subr_bus.c:3747–3766  ·  view source on GitHub ↗

* @brief Helper function for implementing DEVICE_DETACH() * * This function can be used to help implement the DEVICE_DETACH() for * a bus. It calls device_detach() for each of the device's * children. */

Source from the content-addressed store, hash-verified

3745 * children.
3746 */
3747int
3748bus_generic_detach(device_t dev)
3749{
3750 device_t child;
3751 int error;
3752
3753 if (dev->state != DS_ATTACHED)
3754 return (EBUSY);
3755
3756 /*
3757 * Detach children in the reverse order.
3758 * See bus_generic_suspend for details.
3759 */
3760 TAILQ_FOREACH_REVERSE(child, &dev->children, device_list, link) {
3761 if ((error = device_detach(child)) != 0)
3762 return (error);
3763 }
3764
3765 return (0);
3766}
3767
3768/**
3769 * @brief Helper function for implementing DEVICE_SHUTDOWN()

Callers 15

jz4780_nemc_detachFunction · 0.85
jz4780_pinctrl_detachFunction · 0.85
arge_detachFunction · 0.85
are_detachFunction · 0.85
max77620_detachFunction · 0.85
max77620_rtc_detachFunction · 0.85
rk_i2c_detachFunction · 0.85
rk_spi_detachFunction · 0.85
rk_pwm_detachFunction · 0.85
ti_spi_detachFunction · 0.85
ti_i2c_detachFunction · 0.85
ti_adc_detachFunction · 0.85

Calls 1

device_detachFunction · 0.85

Tested by

no test coverage detected