summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_util.c
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2011-11-19 10:11:50 +0000
committerhselasky <hselasky@FreeBSD.org>2011-11-19 10:11:50 +0000
commit3bcdb8772aed66918259718d05cb24d56914ab89 (patch)
treed8ce224aa83a7409b55f7416386eadc3d984598d /sys/dev/usb/usb_util.c
parent57eff55b88ea3dc6a4a8cc80becb3dc21dcbf80c (diff)
downloadFreeBSD-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/usb/usb_util.c')
-rw-r--r--sys/dev/usb/usb_util.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/sys/dev/usb/usb_util.c b/sys/dev/usb/usb_util.c
index 1c357a3..a9b1d6f 100644
--- a/sys/dev/usb/usb_util.c
+++ b/sys/dev/usb/usb_util.c
@@ -58,31 +58,6 @@
#include <dev/usb/usb_bus.h>
/*------------------------------------------------------------------------*
- * device_delete_all_children - delete all children of a device
- *------------------------------------------------------------------------*/
-#ifndef device_delete_all_children
-int
-device_delete_all_children(device_t dev)
-{
- device_t *devlist;
- int devcount;
- int error;
-
- error = device_get_children(dev, &devlist, &devcount);
- if (error == 0) {
- while (devcount-- > 0) {
- error = device_delete_child(dev, devlist[devcount]);
- if (error) {
- break;
- }
- }
- free(devlist, M_TEMP);
- }
- return (error);
-}
-#endif
-
-/*------------------------------------------------------------------------*
* device_set_usb_desc
*
* This function can be called at probe or attach to set the USB
OpenPOWER on IntegriCloud