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/ppbus/ppbconf.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/ppbus/ppbconf.c')
-rw-r--r-- | sys/dev/ppbus/ppbconf.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/ppbus/ppbconf.c b/sys/dev/ppbus/ppbconf.c index 9e21c67..858e5b2 100644 --- a/sys/dev/ppbus/ppbconf.c +++ b/sys/dev/ppbus/ppbconf.c @@ -422,20 +422,14 @@ ppbus_attach(device_t dev) static int ppbus_detach(device_t dev) { - device_t *children; - int error, nchildren, i; + int error; error = bus_generic_detach(dev); if (error) return (error); /* detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - if (children[i]) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); return (0); } |