From 24c386b577f126bce761c7288e987ae93c36aa88 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Fri, 3 Oct 2003 16:44:52 +0000 Subject: Merge tty_attach() in ttymalloc() and tty_detach() in ttyfree(). The need for separate tty registering is gone now that sparc has switched to wscons, and this makes the code less error-prone. Also, remove tests for ttymalloc() failure, since it uses M_WAITOK. ok millert@ deraadt@, tested by various people as well besides me... --- sys/dev/usb/ucom.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/dev/usb/ucom.c') diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index 5bfb473a61d..85f48b50e2f 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucom.c,v 1.19 2003/08/15 20:32:18 tedu Exp $ */ +/* $OpenBSD: ucom.c,v 1.20 2003/10/03 16:44:51 miod Exp $ */ /* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */ /* @@ -211,8 +211,10 @@ USB_ATTACH(ucom) tp->t_param = ucomparam; sc->sc_tty = tp; +#ifndef __OpenBSD__ DPRINTF(("ucom_attach: tty_attach %p\n", tp)); tty_attach(tp); +#endif #if defined(__NetBSD__) && NRND > 0 rnd_attach_source(&sc->sc_rndsource, USBDEVNAME(sc->sc_dev), @@ -271,7 +273,9 @@ USB_DETACH(ucom) /* Detach and free the tty. */ if (tp != NULL) { +#ifndef __OpenBSD__ tty_detach(tp); +#endif ttyfree(tp); sc->sc_tty = NULL; } -- cgit v1.2.3