summaryrefslogtreecommitdiff
path: root/sys/dev/bluetooth
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2011-12-10 16:16:11 +0000
committerjmcneill <jmcneill@NetBSD.org>2011-12-10 16:16:11 +0000
commitd3eb87b087fad93e95334ae08b4d8ff4f12339b6 (patch)
treee425ea7c6f0e494b5302fba2b83635877582f1a2 /sys/dev/bluetooth
parent35359269b1c3fb60ccc18204c0e9721009507e2e (diff)
no need to acquire thread lock in btsco_open / btsco_close, as they are
already held by MI audio when these methods are called
Diffstat (limited to 'sys/dev/bluetooth')
-rw-r--r--sys/dev/bluetooth/btsco.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/bluetooth/btsco.c b/sys/dev/bluetooth/btsco.c
index 031b38d5c78..dc2dedcc94a 100644
--- a/sys/dev/bluetooth/btsco.c
+++ b/sys/dev/bluetooth/btsco.c
@@ -1,4 +1,4 @@
-/* $NetBSD: btsco.c,v 1.25 2011/11/23 23:07:31 jmcneill Exp $ */
+/* $NetBSD: btsco.c,v 1.26 2011/12/10 16:16:11 jmcneill Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.25 2011/11/23 23:07:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.26 2011/12/10 16:16:11 jmcneill Exp $");
#include <sys/param.h>
#include <sys/audioio.h>
@@ -576,7 +576,7 @@ btsco_open(void *hdl, int flags)
if (sc->sc_sco != NULL || sc->sc_sco_l != NULL)
return EIO;
- mutex_enter(bt_lock);
+ KASSERT(mutex_owned(bt_lock));
memset(&sa, 0, sizeof(sa));
sa.bt_len = sizeof(sa);
@@ -653,8 +653,6 @@ btsco_open(void *hdl, int flags)
}
done:
- mutex_exit(bt_lock);
-
DPRINTF("done err=%d, sc_state=%d, sc_mtu=%d\n",
err, sc->sc_state, sc->sc_mtu);
return err;
@@ -667,7 +665,8 @@ btsco_close(void *hdl)
DPRINTF("%s\n", sc->sc_name);
- mutex_enter(bt_lock);
+ KASSERT(mutex_owned(bt_lock));
+
if (sc->sc_sco != NULL) {
sco_disconnect(sc->sc_sco, 0);
sco_detach(&sc->sc_sco);
@@ -676,7 +675,6 @@ btsco_close(void *hdl)
if (sc->sc_sco_l != NULL) {
sco_detach(&sc->sc_sco_l);
}
- mutex_exit(bt_lock);
if (sc->sc_rx_mbuf != NULL) {
m_freem(sc->sc_rx_mbuf);