Module Name:    src
Committed By:   riastradh
Date:           Wed Oct 26 23:42:42 UTC 2022

Modified Files:
        src/sys/net: if_sl.c

Log Message:
sl(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/net/if_sl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if_sl.c
diff -u src/sys/net/if_sl.c:1.135 src/sys/net/if_sl.c:1.136
--- src/sys/net/if_sl.c:1.135	Sat Sep  3 02:47:59 2022
+++ src/sys/net/if_sl.c	Wed Oct 26 23:42:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sl.c,v 1.135 2022/09/03 02:47:59 thorpej Exp $	*/
+/*	$NetBSD: if_sl.c,v 1.136 2022/10/26 23:42:42 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1987, 1989, 1992, 1993
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.135 2022/09/03 02:47:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.136 2022/10/26 23:42:42 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -350,7 +350,7 @@ slopen(dev_t dev, struct tty *tp)
 			tp->t_sc = (void *)sc;
 			sc->sc_ttyp = tp;
 			sc->sc_if.if_baudrate = tp->t_ospeed;
-			mutex_spin_enter(&tty_lock);
+			ttylock(tp);
 			tp->t_state |= TS_ISOPEN | TS_XCLUDE;
 			ttyflush(tp, FREAD | FWRITE);
 			/*
@@ -366,7 +366,7 @@ slopen(dev_t dev, struct tty *tp)
 				sc->sc_oldbufquot = tp->t_outq.c_cq != 0;
 
 				clfree(&tp->t_outq);
-				mutex_spin_exit(&tty_lock);
+				ttyunlock(tp);
 				error = clalloc(&tp->t_outq, 2 * SLMAX + 2, 0);
 				if (error) {
 					softint_disestablish(sc->sc_si);
@@ -379,7 +379,7 @@ slopen(dev_t dev, struct tty *tp)
 				}
 			} else {
 				sc->sc_oldbufsize = sc->sc_oldbufquot = 0;
-				mutex_spin_exit(&tty_lock);
+				ttyunlock(tp);
 			}
 			return 0;
 		}

Reply via email to