summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-10-26 23:50:28 +0000
committerriastradh <riastradh@NetBSD.org>2022-10-26 23:50:28 +0000
commit9ededf9ec6a66f6c7329bda6772e53dea173d33c (patch)
tree45b4003a6da42cb60db92898546e66651597b1ee /sys/dev/usb
parent7670dfdf1071e68b9efb4cbd7bb62e91fabc63fa (diff)
ucycom(4): Convert to ttylock/ttyunlock.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/ucycom.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c
index 51566f6c4b8..df897bf2436 100644
--- a/sys/dev/usb/ucycom.c
+++ b/sys/dev/usb/ucycom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ucycom.c,v 1.55 2022/03/28 12:44:17 riastradh Exp $ */
+/* $NetBSD: ucycom.c,v 1.56 2022/10/26 23:50:28 riastradh Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.55 2022/03/28 12:44:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucycom.c,v 1.56 2022/10/26 23:50:28 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -272,11 +272,11 @@ ucycom_detach(device_t self, int flags)
s = splusb();
if (tp != NULL) {
- mutex_spin_enter(&tty_lock);
+ ttylock(tp);
CLR(tp->t_state, TS_CARR_ON);
CLR(tp->t_cflag, CLOCAL | MDMBUF);
ttyflush(tp, FREAD|FWRITE);
- mutex_spin_exit(&tty_lock);
+ ttyunlock(tp);
}
/* Wait for processes to go away. */
usb_detach_waitold(sc->sc_dev);
@@ -490,7 +490,7 @@ ucycomstart(struct tty *tp)
u_char *data;
int cnt, len, s;
- KASSERT(mutex_owned(&tty_lock));
+ KASSERT(ttylocked(tp));
if (sc->sc_dying)
return;