summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-10-03 16:44:52 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-10-03 16:44:52 +0000
commit24c386b577f126bce761c7288e987ae93c36aa88 (patch)
tree99166e0d499a2be11543cc5dd9774c63a12466eb /sys/dev/ic
parente43c66ff4e929d0beb6716fb882523dc136b8c0c (diff)
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...
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/com.c4
-rw-r--r--sys/dev/ic/cy.c11
-rw-r--r--sys/dev/ic/z8530tty.c3
3 files changed, 4 insertions, 14 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index 1d76f57cdfa..c6b39f06882 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com.c,v 1.93 2003/09/23 16:51:12 millert Exp $ */
+/* $OpenBSD: com.c,v 1.94 2003/10/03 16:44:51 miod Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -403,7 +403,6 @@ com_detach(self, flags)
/* Detach and free the tty. */
if (sc->sc_tty) {
- tty_detach(sc->sc_tty);
ttyfree(sc->sc_tty);
}
@@ -483,7 +482,6 @@ comopen(dev, flag, mode, p)
s = spltty();
if (!sc->sc_tty) {
tp = sc->sc_tty = ttymalloc();
- tty_attach(tp);
} else
tp = sc->sc_tty;
splx(s);
diff --git a/sys/dev/ic/cy.c b/sys/dev/ic/cy.c
index 04fb4d49c20..897e889b369 100644
--- a/sys/dev/ic/cy.c
+++ b/sys/dev/ic/cy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cy.c,v 1.23 2003/08/15 20:32:17 tedu Exp $ */
+/* $OpenBSD: cy.c,v 1.24 2003/10/03 16:44:51 miod Exp $ */
/*
* Copyright (c) 1996 Timo Rossi.
* All rights reserved.
@@ -300,18 +300,11 @@ cyopen(dev, flag, mode, p)
s = spltty();
if (cy->cy_tty == NULL) {
- if ((cy->cy_tty = ttymalloc()) == NULL) {
- splx(s);
- printf("%s port %d open: can't allocate tty\n",
- sc->sc_dev.dv_xname, port);
- return (ENOMEM);
- }
+ cy->cy_tty = ttymalloc();
}
splx(s);
tp = cy->cy_tty;
- tty_attach(tp);
- tp = cy->cy_tty;
tp->t_oproc = cystart;
tp->t_param = cyparam;
tp->t_dev = dev;
diff --git a/sys/dev/ic/z8530tty.c b/sys/dev/ic/z8530tty.c
index c414f09358f..257a86ae3c9 100644
--- a/sys/dev/ic/z8530tty.c
+++ b/sys/dev/ic/z8530tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530tty.c,v 1.13 2003/08/15 20:32:17 tedu Exp $ */
+/* $OpenBSD: z8530tty.c,v 1.14 2003/10/03 16:44:51 miod Exp $ */
/* $NetBSD: z8530tty.c,v 1.13 1996/10/16 20:42:14 gwr Exp $ */
/*
@@ -259,7 +259,6 @@ zstty_attach(parent, self, aux)
tp->t_oproc = zsstart;
tp->t_param = zsparam;
tp->t_hwiflow = zshwiflow;
- tty_attach(tp);
zst->zst_tty = tp;
zst->zst_rbhiwat = zstty_rbuf_size; /* impossible value */