Page MenuHomeFreeBSD

D60512.id189179.diff
No OneTemporary

D60512.id189179.diff

diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1151,7 +1151,6 @@
int err, i, direction, *vchanrate, *vchanformat;
PCM_BUSYASSERT(d);
- PCM_LOCKASSERT(d);
switch (dir) {
case PCMDIR_PLAY:
@@ -1181,7 +1180,6 @@
return (NULL);
}
- PCM_UNLOCK(d);
b = NULL;
bs = NULL;
@@ -1261,7 +1259,6 @@
goto fail;
}
- PCM_LOCK(d);
CHN_INSERT_SORT_ASCEND(d, c, channels.pcm);
if ((c->flags & CHN_F_VIRTUAL) == 0) {
CHN_INSERT_SORT_ASCEND(d, c, channels.pcm.primary);
@@ -1274,7 +1271,6 @@
fail:
chn_kill(c);
- PCM_LOCK(d);
return (NULL);
}
@@ -1288,7 +1284,6 @@
PCM_BUSYASSERT(c->parentsnddev);
- PCM_LOCK(d);
CHN_REMOVE(d, c, channels.pcm);
if ((c->flags & CHN_F_VIRTUAL) == 0)
CHN_REMOVE(d, c, channels.pcm.primary);
@@ -1309,7 +1304,6 @@
default:
__assert_unreachable();
}
- PCM_UNLOCK(d);
if (CHN_STARTED(c)) {
CHN_LOCK(c);
diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h
--- a/sys/dev/sound/pcm/sound.h
+++ b/sys/dev/sound/pcm/sound.h
@@ -209,7 +209,6 @@
#define PCM_LOCK(d) mtx_lock(&(d)->lock)
#define PCM_UNLOCK(d) mtx_unlock(&(d)->lock)
-#define PCM_LOCKASSERT(d) mtx_assert(&(d)->lock, MA_OWNED)
#define PCM_UNLOCKASSERT(d) mtx_assert(&(d)->lock, MA_NOTOWNED)
#define PCM_ACQUIRE(d) do { \
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -133,14 +133,12 @@
int err = 0;
PCM_ACQUIRE(d);
- PCM_LOCK(d);
ch = chn_init(d, NULL, cls, dir, devinfo);
if (!ch) {
device_printf(d->dev, "chn_init(%s, %d, %p) failed\n",
cls->name, dir, devinfo);
err = ENODEV;
}
- PCM_UNLOCK(d);
PCM_RELEASE(d);
return (err);
diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c
--- a/sys/dev/sound/pcm/vchan.c
+++ b/sys/dev/sound/pcm/vchan.c
@@ -605,14 +605,12 @@
return (EINVAL);
CHN_UNLOCK(parent);
- PCM_LOCK(d);
/*
* This is the only place where channels are created at runtime, so do
* not create any if we are tearing down.
*/
if (!PCM_REGISTERED(d)) {
- PCM_UNLOCK(d);
CHN_LOCK(parent);
return (ENODEV);
}
@@ -630,11 +628,9 @@
/* create a new playback channel */
ch = chn_init(d, parent, &vchan_class, direction, parent);
if (ch == NULL) {
- PCM_UNLOCK(d);
CHN_LOCK(parent);
return (ENODEV);
}
- PCM_UNLOCK(d);
CHN_LOCK(parent);
CHN_INSERT_SORT_ASCEND(parent, ch, children);

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 10, 9:42 AM (7 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40538123
Default Alt Text
D60512.id189179.diff (2 KB)

Event Timeline