summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-01-26 14:00:25 +0000
committerjoe <joe@FreeBSD.org>2002-01-26 14:00:25 +0000
commit937876516bed63d8313631357d0379aec29aa85f (patch)
tree9e88f1e4ad870397c357b7c62f1431045dd75306 /sys/dev
parent29110fc739e2c48d2651c0482ea0e38f85401df4 (diff)
downloadFreeBSD-src-937876516bed63d8313631357d0379aec29aa85f.zip
FreeBSD-src-937876516bed63d8313631357d0379aec29aa85f.tar.gz
Rearrange the code in USB_DETACH, so that it's like NetBSD's. No
functional change.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uhub.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index 334fe2a..0533249 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -503,7 +503,7 @@ uhub_activate(device_ptr_t self, enum devact act)
USB_DETACH(uhub)
{
USB_DETACH_START(uhub, sc);
- struct usbd_hub *hub = sc->sc_hub->hub;
+ usbd_device_handle dev = sc->sc_hub;
struct usbd_port *rup;
int port, nports;
@@ -513,22 +513,22 @@ USB_DETACH(uhub)
DPRINTF(("uhub_detach: sc=%port\n", sc));
#endif
- if (hub == NULL) /* Must be partially working */
+ if (dev->hub == NULL) /* Must be partially working */
return (0);
usbd_abort_pipe(sc->sc_ipipe);
usbd_close_pipe(sc->sc_ipipe);
- nports = hub->hubdesc.bNbrPorts;
+ nports = dev->hub->hubdesc.bNbrPorts;
for(port = 0; port < nports; port++) {
- rup = &hub->ports[port];
+ rup = &dev->hub->ports[port];
if (rup->device)
usb_disconnect_port(rup, self);
}
- free(hub, M_USBDEV);
- sc->sc_hub->hub = NULL;
+ free(dev->hub, M_USBDEV);
+ dev->hub = NULL;
return (0);
}
OpenPOWER on IntegriCloud