From 3bcdb8772aed66918259718d05cb24d56914ab89 Mon Sep 17 00:00:00 2001 From: hselasky Date: Sat, 19 Nov 2011 10:11:50 +0000 Subject: 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 --- sys/dev/siis/siis.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'sys/dev/siis/siis.c') 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, -- cgit v1.1