Add calls to pmf_deregister on detach.

This commit is contained in:
smb 2008-01-04 03:56:47 +00:00
parent f0fe5d20cf
commit 0cb6d977ab
2 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhub.c,v 1.92 2007/12/09 20:28:24 jmcneill Exp $ */
/* $NetBSD: uhub.c,v 1.93 2008/01/04 03:56:47 smb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
/*
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.92 2007/12/09 20:28:24 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.93 2008/01/04 03:56:47 smb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -598,6 +598,7 @@ USB_DETACH(uhub)
if (hub == NULL) /* Must be partially working */
return (0);
pmf_device_deregister(self);
usbd_abort_pipe(sc->sc_ipipe);
usbd_close_pipe(sc->sc_ipipe);

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.c,v 1.104 2007/12/09 20:28:25 jmcneill Exp $ */
/* $NetBSD: usb.c,v 1.105 2008/01/04 03:56:48 smb Exp $ */
/*
* Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.104 2007/12/09 20:28:25 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.105 2008/01/04 03:56:48 smb Exp $");
#include "opt_compat_netbsd.h"
@ -917,6 +917,7 @@ usb_detach(device_ptr_t self, int flags)
DPRINTF(("usb_detach: start\n"));
pmf_device_deregister(self);
/* Kill off event thread. */
while (sc->sc_event_thread != NULL) {
wakeup(&sc->sc_bus->needs_explore);