summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
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
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')
-rw-r--r--sys/dev/usb/usb_util.c25
-rw-r--r--sys/dev/usb/usb_util.h1
2 files changed, 0 insertions, 26 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
diff --git a/sys/dev/usb/usb_util.h b/sys/dev/usb/usb_util.h
index 35abedd..7e52404 100644
--- a/sys/dev/usb/usb_util.h
+++ b/sys/dev/usb/usb_util.h
@@ -27,7 +27,6 @@
#ifndef _USB_UTIL_H_
#define _USB_UTIL_H_
-int device_delete_all_children(device_t dev);
uint8_t usb_make_str_desc(void *ptr, uint16_t max_len, const char *s);
void usb_printbcd(char *p, uint16_t p_len, uint16_t bcd);
void usb_trim_spaces(char *p);
OpenPOWER on IntegriCloud