aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pcm/sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/pcm/sound.c')
-rw-r--r--sys/dev/sound/pcm/sound.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index cb510d526fa8..29dac6b576ae 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -62,35 +62,6 @@ SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
*/
struct unrhdr *pcmsg_unrhdr = NULL;
-void *
-snd_mtxcreate(const char *desc, const char *type)
-{
- struct mtx *m;
-
- m = malloc(sizeof(*m), M_DEVBUF, M_WAITOK | M_ZERO);
- mtx_init(m, desc, type, MTX_DEF);
- return m;
-}
-
-void
-snd_mtxfree(void *m)
-{
- struct mtx *mtx = m;
-
- mtx_destroy(mtx);
- free(mtx, M_DEVBUF);
-}
-
-void
-snd_mtxassert(void *m)
-{
-#ifdef INVARIANTS
- struct mtx *mtx = m;
-
- mtx_assert(mtx, MA_OWNED);
-#endif
-}
-
int
snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand, void *param, void **cookiep)
{
@@ -361,7 +332,7 @@ pcm_init(device_t dev, void *devinfo)
d = device_get_softc(dev);
d->dev = dev;
- d->lock = snd_mtxcreate(device_get_nameunit(dev), "sound cdev");
+ mtx_init(&d->lock, device_get_nameunit(dev), "sound cdev", MTX_DEF);
cv_init(&d->cv, device_get_nameunit(dev));
i = 0;
@@ -467,7 +438,7 @@ pcm_unregister(device_t dev)
d = device_get_softc(dev);
- if (!PCM_ALIVE(d)) {
+ if (!PCM_REGISTERED(d)) {
device_printf(dev, "unregister: device not configured\n");
return (0);
}
@@ -498,7 +469,7 @@ pcm_unregister(device_t dev)
dsp_destroy_dev(dev);
cv_destroy(&d->cv);
- snd_mtxfree(d->lock);
+ mtx_destroy(&d->lock);
if (snd_unit == device_get_unit(dev)) {
snd_unit = pcm_best_unit(-1);