diff options
Diffstat (limited to 'sys/dev/aac/aac.c')
-rw-r--r-- | sys/dev/aac/aac.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 34dbb56a66f7..2519c66e81d4 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -441,8 +441,7 @@ aac_startup(void *arg) sc->aac_state &= ~AAC_STATE_SUSPEND; /* poke the bus to actually attach the child devices */ - if (bus_generic_attach(sc->aac_dev)) - device_printf(sc->aac_dev, "bus_generic_attach failed\n"); + bus_attach_children(sc->aac_dev); /* disconnect ourselves from the intrhook chain */ config_intrhook_disestablish(&sc->aac_ich); @@ -474,7 +473,7 @@ aac_add_container(struct aac_softc *sc, struct aac_mntinforesp *mir, int f) mir->MntTable[0].FileSystemName, mir->MntTable[0].Capacity, mir->MntTable[0].VolType); - if ((child = device_add_child(sc->aac_dev, "aacd", -1)) == NULL) + if ((child = device_add_child(sc->aac_dev, "aacd", DEVICE_UNIT_ANY)) == NULL) device_printf(sc->aac_dev, "device_add_child failed\n"); else device_set_ivars(child, co); @@ -670,6 +669,10 @@ aac_detach(device_t dev) sc = device_get_softc(dev); fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); + error = bus_generic_detach(dev); + if (error != 0) + return (error); + callout_drain(&sc->aac_daemontime); mtx_lock(&sc->aac_io_lock); @@ -684,9 +687,6 @@ aac_detach(device_t dev) /* Remove the child containers */ while ((co = TAILQ_FIRST(&sc->aac_container_tqh)) != NULL) { - error = device_delete_child(dev, co->co_disk); - if (error) - return (error); TAILQ_REMOVE(&sc->aac_container_tqh, co, co_link); free(co, M_AACBUF); } @@ -694,9 +694,6 @@ aac_detach(device_t dev) /* Remove the CAM SIMs */ while ((sim = TAILQ_FIRST(&sc->aac_sim_tqh)) != NULL) { TAILQ_REMOVE(&sc->aac_sim_tqh, sim, sim_link); - error = device_delete_child(dev, sim->sim_dev); - if (error) - return (error); free(sim, M_AACBUF); } @@ -3324,7 +3321,7 @@ aac_handle_aif(struct aac_softc *sc, struct aac_fib *fib) if (added) { mtx_unlock(&sc->aac_io_lock); bus_topo_lock(); - bus_generic_attach(sc->aac_dev); + bus_attach_children(sc->aac_dev); bus_topo_unlock(); mtx_lock(&sc->aac_io_lock); } @@ -3785,7 +3782,7 @@ aac_get_bus_info(struct aac_softc *sc) break; } - child = device_add_child(sc->aac_dev, "aacp", -1); + child = device_add_child(sc->aac_dev, "aacp", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->aac_dev, "device_add_child failed for passthrough bus %d\n", @@ -3808,5 +3805,5 @@ aac_get_bus_info(struct aac_softc *sc) } if (found) - bus_generic_attach(sc->aac_dev); + bus_attach_children(sc->aac_dev); } |