aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/controller/ehci_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/controller/ehci_pci.c')
-rw-r--r--sys/dev/usb/controller/ehci_pci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/controller/ehci_pci.c b/sys/dev/usb/controller/ehci_pci.c
index 2aa0cd2fbcd8..d7298ab89df7 100644
--- a/sys/dev/usb/controller/ehci_pci.c
+++ b/sys/dev/usb/controller/ehci_pci.c
@@ -30,7 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
/*
* USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller.
*
@@ -360,7 +359,7 @@ ehci_pci_attach(device_t self)
device_printf(self, "Could not allocate irq\n");
goto error;
}
- sc->sc_bus.bdev = device_add_child(self, "usbus", -1);
+ sc->sc_bus.bdev = device_add_child(self, "usbus", DEVICE_UNIT_ANY);
if (!sc->sc_bus.bdev) {
device_printf(self, "Could not add USB device\n");
goto error;
@@ -505,9 +504,12 @@ static int
ehci_pci_detach(device_t self)
{
ehci_softc_t *sc = device_get_softc(self);
+ int error;
/* during module unload there are lots of children leftover */
- device_delete_children(self);
+ error = bus_generic_detach(self);
+ if (error != 0)
+ return (error);
pci_disable_busmaster(self);