diff options
Diffstat (limited to 'sys/dev/usb/controller/ehci_msm.c')
-rw-r--r-- | sys/dev/usb/controller/ehci_msm.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/usb/controller/ehci_msm.c b/sys/dev/usb/controller/ehci_msm.c index 37e330fd6ea7..2586df634b3c 100644 --- a/sys/dev/usb/controller/ehci_msm.c +++ b/sys/dev/usb/controller/ehci_msm.c @@ -31,7 +31,6 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> #include "opt_bus.h" #include <sys/param.h> @@ -125,7 +124,7 @@ ehci_msm_attach(device_t dev) panic("%s: unable to subregion USB host registers", device_get_name(dev)); - 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) { device_printf(dev, "Could not add USB device\n"); goto error; @@ -171,13 +170,9 @@ ehci_msm_detach(device_t dev) sc = device_get_softc(dev); - if (sc->sc_bus.bdev) { - bdev = sc->sc_bus.bdev; - device_detach(bdev); - device_delete_child(dev, bdev); - } - - device_delete_children(dev); + err = bus_generic_detach(dev); + if (err != 0) + return (err); if (sc->sc_irq_res && sc->sc_intr_hdl) { /* only call ehci_detach() after ehci_init() */ |