Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic cy(4): Convert to ttylock/ttyunlock.



details:   https://anonhg.NetBSD.org/src/rev/00aedae96c19
branches:  trunk
changeset: 372083:00aedae96c19
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Oct 26 23:42:04 2022 +0000

description:
cy(4): Convert to ttylock/ttyunlock.

diffstat:

 sys/dev/ic/cy.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 11d5dde04143 -r 00aedae96c19 sys/dev/ic/cy.c
--- a/sys/dev/ic/cy.c   Wed Oct 26 23:41:49 2022 +0000
+++ b/sys/dev/ic/cy.c   Wed Oct 26 23:42:04 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cy.c,v 1.62 2019/11/10 21:16:35 chs Exp $      */
+/*     $NetBSD: cy.c,v 1.63 2022/10/26 23:42:04 riastradh Exp $        */
 
 /*
  * cy.c
@@ -16,7 +16,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.62 2019/11/10 21:16:35 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cy.c,v 1.63 2022/10/26 23:42:04 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -380,18 +380,18 @@
 
        /* wait for carrier if necessary */
        if (!ISSET(flag, O_NONBLOCK)) {
-               mutex_spin_enter(&tty_lock);
+               ttylock(tp);
                while (!ISSET(tp->t_cflag, CLOCAL) &&
                    !ISSET(tp->t_state, TS_CARR_ON)) {
                        tp->t_wopen++;
                        error = ttysleep(tp, &tp->t_rawcv, true, 0);
                        tp->t_wopen--;
                        if (error != 0) {
-                               mutex_spin_exit(&tty_lock);
+                               ttyunlock(tp);
                                return error;
                        }
                }
-               mutex_spin_exit(&tty_lock);
+               ttyunlock(tp);
        }
 
        return (*tp->t_linesw->l_open) (dev, tp);



Home | Main Index | Thread Index | Old Index