diff options
author | hselasky <hselasky@FreeBSD.org> | 2011-11-19 10:11:50 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2011-11-19 10:11:50 +0000 |
commit | 3bcdb8772aed66918259718d05cb24d56914ab89 (patch) | |
tree | d8ce224aa83a7409b55f7416386eadc3d984598d /sys/dev/siis/siis.c | |
parent | 57eff55b88ea3dc6a4a8cc80becb3dc21dcbf80c (diff) | |
download | FreeBSD-src-3bcdb8772aed66918259718d05cb24d56914ab89.zip FreeBSD-src-3bcdb8772aed66918259718d05cb24d56914ab89.tar.gz |
Move the device_delete_all_children() function from usb_util.c
to kern/subr_bus.c. Simplify this function so that it no longer
depends on malloc() to execute. Identify a few other places where
it makes sense to use device_delete_all_children().
MFC after: 1 week
Diffstat (limited to 'sys/dev/siis/siis.c')
-rw-r--r-- | sys/dev/siis/siis.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c index 97b2489..40c17cb 100644 --- a/sys/dev/siis/siis.c +++ b/sys/dev/siis/siis.c @@ -205,15 +205,10 @@ static int siis_detach(device_t dev) { struct siis_controller *ctlr = device_get_softc(dev); - device_t *children; - int nchildren, i; /* Detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); + /* Free interrupts. */ if (ctlr->irq.r_irq) { bus_teardown_intr(dev, ctlr->irq.r_irq, |