subr_bus.c (a89a562b6059f3269ad081059d37b343dfc5b92a) subr_bus.c (b832a7e5053cd29ec8d5421482ffd3b311e27092)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 1997,1998,2003 Doug Rabson
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 3739 unchanged lines hidden (view full) ---

3748 TAILQ_FOREACH(child, &dev->children, link) {
3749 device_probe_and_attach(child);
3750 }
3751
3752 return (0);
3753}
3754
3755/**
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 1997,1998,2003 Doug Rabson
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 3739 unchanged lines hidden (view full) ---

3748 TAILQ_FOREACH(child, &dev->children, link) {
3749 device_probe_and_attach(child);
3750 }
3751
3752 return (0);
3753}
3754
3755/**
3756 * @brief Helper function for delaying attaching children
3757 *
3758 * Many buses can't run transactions on the bus which children need to probe and
3759 * attach until after interrupts and/or timers are running. This function
3760 * delays their attach until interrupts and timers are enabled.
3761 */
3762int
3763bus_delayed_attach_children(device_t dev)
3764{
3765 /* Probe and attach the bus children when interrupts are available */
3766 config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev);
3767
3768 return (0);
3769}
3770
3771/**
3756 * @brief Helper function for implementing DEVICE_DETACH()
3757 *
3758 * This function can be used to help implement the DEVICE_DETACH() for
3759 * a bus. It calls device_detach() for each of the device's
3760 * children.
3761 */
3762int
3763bus_generic_detach(device_t dev)

--- 2242 unchanged lines hidden ---
3772 * @brief Helper function for implementing DEVICE_DETACH()
3773 *
3774 * This function can be used to help implement the DEVICE_DETACH() for
3775 * a bus. It calls device_detach() for each of the device's
3776 * children.
3777 */
3778int
3779bus_generic_detach(device_t dev)

--- 2242 unchanged lines hidden ---