From 031911c6047bee7f56c1f952b69805a2e41e0c69 Mon Sep 17 00:00:00 2001 From: Nick Hibma Date: Mon, 8 Nov 1999 21:12:25 +0000 Subject: Remove superfluous header file includes Remove definition of initialiser. Some clean up. --- sys/dev/usb/uhub.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sys/dev/usb/uhub.c') diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 5125f1d0a361..6b859b9d54c7 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -48,11 +48,11 @@ #include #if defined(__NetBSD__) || defined(__OpenBSD__) #include +#include #elif defined(__FreeBSD__) #include #include #endif -#include #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++) { -- cgit v1.2.3