sys/dev/usbmisc/ucom/ucom.c
static void
ucom_cleanup(struct ucom_softc *sc)
{
	ASSERT_LWKT_TOKEN_HELD(&tty_token);
	DPRINTF(("ucom_cleanup: closing pipes\n"));

	ucom_shutdown(sc);
	if (sc->sc_bulkin_pipe != NULL) {
		usbd_abort_pipe(sc->sc_bulkin_pipe);
		usbd_close_pipe(sc->sc_bulkin_pipe);
		sc->sc_bulkin_pipe = NULL;
	}
	if (sc->sc_bulkout_pipe != NULL) {
		usbd_abort_pipe(sc->sc_bulkout_pipe);
		usbd_close_pipe(sc->sc_bulkout_pipe);
		sc->sc_bulkout_pipe = NULL;
	}
	if (sc->sc_ixfer != NULL) {
		usbd_free_xfer(sc->sc_ixfer);
		sc->sc_ixfer = NULL;
	}
	if (sc->sc_oxfer != NULL) {
		usbd_free_xfer(sc->sc_oxfer);
		sc->sc_oxfer = NULL;
	}
}
/*
 * NOTE: Must be called with tty_token held.
 */
Must be called with tty_token held.
Must be called with tty_token held .
static void
ucom_cleanup(struct ucom_softc *sc)
{
	ASSERT_LWKT_TOKEN_HELD(&tty_token);
	DPRINTF(("ucom_cleanup: closing pipes\n"));
	ucom_shutdown(sc);
	if (sc->sc_bulkin_pipe != NULL) {
		usbd_abort_pipe(sc->sc_bulkin_pipe);
		usbd_close_pipe(sc->sc_bulkin_pipe);
		sc->sc_bulkin_pipe = NULL;
	}
	if (sc->sc_bulkout_pipe != NULL) {
		usbd_abort_pipe(sc->sc_bulkout_pipe);
		usbd_close_pipe(sc->sc_bulkout_pipe);
		sc->sc_bulkout_pipe = NULL;
	}
	if (sc->sc_ixfer != NULL) {
		usbd_free_xfer(sc->sc_ixfer);
		sc->sc_ixfer = NULL;
	}
	if (sc->sc_oxfer != NULL) {
		usbd_free_xfer(sc->sc_oxfer);
		sc->sc_oxfer = NULL;
	}
}
static void ucom_cleanup ( struct ucom_softc * sc ) { ASSERT_LWKT_TOKEN_HELD ( & tty_token ) ; DPRINTF ( ( " \n " ) ) ; ucom_shutdown ( sc ) ; if ( sc -> sc_bulkin_pipe != NULL ) { usbd_abort_pipe ( sc -> sc_bulkin_pipe ) ; usbd_close_pipe ( sc -> sc_bulkin_pipe ) ; sc -> sc_bulkin_pipe = NULL ; } if ( sc -> sc_bulkout_pipe != NULL ) { usbd_abort_pipe ( sc -> sc_bulkout_pipe ) ; usbd_close_pipe ( sc -> sc_bulkout_pipe ) ; sc -> sc_bulkout_pipe = NULL ; } if ( sc -> sc_ixfer != NULL ) { usbd_free_xfer ( sc -> sc_ixfer ) ; sc -> sc_ixfer = NULL ; } if ( sc -> sc_oxfer != NULL ) { usbd_free_xfer ( sc -> sc_oxfer ) ; sc -> sc_oxfer = NULL ; } }
NOTE: Must be called with tty_token held.
NOTE : Must be called with tty_token held .