diff options
Diffstat (limited to 'sys/dev/usb/controller/generic_xhci.c')
-rw-r--r-- | sys/dev/usb/controller/generic_xhci.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/usb/controller/generic_xhci.c b/sys/dev/usb/controller/generic_xhci.c index e89d1bc84497..16bda77e043d 100644 --- a/sys/dev/usb/controller/generic_xhci.c +++ b/sys/dev/usb/controller/generic_xhci.c @@ -27,7 +27,6 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> #include <sys/stdint.h> #include <sys/stddef.h> #include <sys/param.h> @@ -99,7 +98,7 @@ generic_xhci_attach(device_t dev) return (ENXIO); } - sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + sc->sc_bus.bdev = device_add_child(dev, "usbus", DEVICE_UNIT_ANY); if (sc->sc_bus.bdev == NULL) { device_printf(dev, "Failed to add USB device\n"); generic_xhci_detach(dev); @@ -152,7 +151,9 @@ generic_xhci_detach(device_t dev) int err; /* during module unload there are lots of children leftover */ - device_delete_children(dev); + err = bus_generic_detach(dev); + if (err != 0) + return (err); if (sc->sc_irq_res != NULL && sc->sc_intr_hdl != NULL) { err = bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intr_hdl); |