Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/qbus vax/dhu(4): Convert to ttylock/ttyunlock.



details:   https://anonhg.NetBSD.org/src/rev/accd6a7e4b5a
branches:  trunk
changeset: 372094:accd6a7e4b5a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Oct 26 23:46:37 2022 +0000

description:
vax/dhu(4): Convert to ttylock/ttyunlock.

diffstat:

 sys/dev/qbus/dhu.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (46 lines):

diff -r 0f7b5400f797 -r accd6a7e4b5a sys/dev/qbus/dhu.c
--- a/sys/dev/qbus/dhu.c        Wed Oct 26 23:46:24 2022 +0000
+++ b/sys/dev/qbus/dhu.c        Wed Oct 26 23:46:37 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dhu.c,v 1.57 2014/07/25 08:10:38 dholland Exp $        */
+/*     $NetBSD: dhu.c,v 1.58 2022/10/26 23:46:37 riastradh Exp $       */
 /*
  * Copyright (c) 2003, Hugh Graham.
  * Copyright (c) 1992, 1993
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dhu.c,v 1.57 2014/07/25 08:10:38 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dhu.c,v 1.58 2022/10/26 23:46:37 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -439,7 +439,8 @@
        if (line >= sc->sc_lines)
                return ENXIO;
 
-       mutex_spin_enter(&tty_lock);
+       tp = sc->sc_dhu[line].dhu_tty;
+       ttylock(tp);
        if (sc->sc_type == IS_DHU) {
                /* CSR 3:0 must be 0 */
                DHU_WRITE_BYTE(DHU_UBA_CSR, DHU_CSR_RXIE);
@@ -449,8 +450,6 @@
        DHU_WRITE_BYTE(DHU_UBA_CSR, DHU_CSR_RXIE | line);
        sc->sc_dhu[line].dhu_modem = DHU_READ_WORD(DHU_UBA_STAT);
 
-       tp = sc->sc_dhu[line].dhu_tty;
-
        if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
                return (EBUSY);
 
@@ -482,7 +481,7 @@
                if (error)
                        break;
        }
-       mutex_spin_exit(&tty_lock);
+       ttyunlock(tp);
        if (error)
                return (error);
        return ((*tp->t_linesw->l_open)(dev, tp));



Home | Main Index | Thread Index | Old Index