diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-11-08 21:12:25 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-11-08 21:12:25 +0000 |
commit | 63c4c3e1daae7f753524e0d7262a5f8c182807dc (patch) | |
tree | 17567cc3c96e38927953a4ca3245f08e3560736a /sys/dev/usb/uhub.c | |
parent | f937576f3ab0aee6ef7dbcfe46ab77b4cf30d150 (diff) | |
download | FreeBSD-src-63c4c3e1daae7f753524e0d7262a5f8c182807dc.zip FreeBSD-src-63c4c3e1daae7f753524e0d7262a5f8c182807dc.tar.gz |
Remove superfluous header file includes
Remove definition of initialiser.
Some clean up.
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r-- | sys/dev/usb/uhub.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 5125f1d..6b859b9 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -48,11 +48,11 @@ #include <sys/malloc.h> #if defined(__NetBSD__) || defined(__OpenBSD__) #include <sys/device.h> +#include <sys/proc.h> #elif defined(__FreeBSD__) #include <sys/module.h> #include <sys/bus.h> #endif -#include <sys/proc.h> #include "bus_if.h" @@ -87,20 +87,22 @@ void uhub_intr __P((usbd_request_handle, usbd_private_handle, usbd_status)); static bus_child_detached_t uhub_child_detached; #endif -USB_DECLARE_DRIVER_INIT(uhub, DEVMETHOD(bus_child_detached, uhub_child_detached)); - /* We need two attachment points: * hub to usb and hub to hub * Every other driver only connects to hubs */ #if defined(__NetBSD__) || defined(__OpenBSD__) +USB_DECLARE_DRIVER(uhub); + /* Create the driver instance for the hub connected to hub case */ struct cfattach uhub_uhub_ca = { sizeof(struct uhub_softc), uhub_match, uhub_attach, uhub_detach, uhub_activate }; #elif defined(__FreeBSD__) +USB_DECLARE_DRIVER_INIT(uhub, DEVMETHOD(bus_child_detached, uhub_child_detached)); + /* Create the driver instance for the hub connected to usb case. */ devclass_t uhubroot_devclass; @@ -539,7 +541,8 @@ uhub_child_detached(self, child) /* should never happen; children are only created after init */ panic("hub not fully initialised, but child deleted?"); - for (port = 0; port < dev->hub->hubdesc.bNbrPorts; port++) { + nports = dev->hub->hubdesc.bNbrPorts; + for (port = 0; port < nports; port++) { up = &dev->hub->ports[port]; if (up->device && up->device->subdevs) { for (i = 0; up->device->subdevs[i]; i++) { |