diff options
author | John Baldwin <jhb@FreeBSD.org> | 2025-01-02 18:25:12 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2025-01-02 18:25:12 +0000 |
commit | 11a9117871e6037ae7b8011b243939322efce569 (patch) | |
tree | 2a8fffe9baa328b7f236a3cba326f7155d5b7514 /sys/dev/enetc | |
parent | 0ac15e476d8732bd749768e3fb80e0075f5ad4c0 (diff) |
Use bus_generic_detach to detach and delete child devices during detach
This is simpler and more robust than individual calls to
device_delete_child.
Differential Revision: https://reviews.freebsd.org/D47972
Diffstat (limited to 'sys/dev/enetc')
-rw-r--r-- | sys/dev/enetc/if_enetc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c index 3c0bc4723b05..3a5d6ec23282 100644 --- a/sys/dev/enetc/if_enetc.c +++ b/sys/dev/enetc/if_enetc.c @@ -459,8 +459,7 @@ enetc_detach(if_ctx_t ctx) for (i = 0; i < sc->rx_num_queues; i++) iflib_irq_free(ctx, &sc->rx_queues[i].irq); - if (sc->miibus != NULL) - device_delete_child(sc->dev, sc->miibus); + bus_generic_detach(sc->dev); if (sc->regs != NULL) error = bus_release_resource(sc->dev, SYS_RES_MEMORY, |