aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pci/solo.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/pci/solo.c')
-rw-r--r--sys/dev/sound/pci/solo.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c
index 90dd2e26ad41..2b61b594a8f3 100644
--- a/sys/dev/sound/pci/solo.c
+++ b/sys/dev/sound/pci/solo.c
@@ -97,12 +97,12 @@ struct ess_info {
unsigned int bufsz;
struct ess_chinfo pch, rch;
- struct mtx *lock;
+ struct mtx lock;
};
-#define ess_lock(_ess) snd_mtxlock((_ess)->lock)
-#define ess_unlock(_ess) snd_mtxunlock((_ess)->lock)
-#define ess_lock_assert(_ess) snd_mtxassert((_ess)->lock)
+#define ess_lock(_ess) mtx_lock(&(_ess)->lock)
+#define ess_unlock(_ess) mtx_unlock(&(_ess)->lock)
+#define ess_lock_assert(_ess) mtx_assert(&(_ess)->lock, MA_OWNED)
static int ess_rd(struct ess_info *sc, int reg);
static void ess_wr(struct ess_info *sc, int reg, u_int8_t val);
@@ -584,7 +584,8 @@ esschan_trigger(kobj_t obj, void *data, int go)
ess_lock(sc);
switch (go) {
case PCMTRIG_START:
- ess_dmasetup(sc, ch->hwch, sndbuf_getbufaddr(ch->buffer), sndbuf_getsize(ch->buffer), ch->dir);
+ ess_dmasetup(sc, ch->hwch, ch->buffer->buf_addr,
+ ch->buffer->bufsize, ch->dir);
ess_dmatrigger(sc, ch->hwch, 1);
ess_start(ch);
break;
@@ -854,10 +855,7 @@ ess_release_resources(struct ess_info *sc, device_t dev)
sc->parent_dmat = 0;
}
- if (sc->lock) {
- snd_mtxfree(sc->lock);
- sc->lock = NULL;
- }
+ mtx_destroy(&sc->lock);
free(sc, M_DEVBUF);
}
@@ -886,10 +884,11 @@ ess_alloc_resources(struct ess_info *sc, device_t dev)
sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
RF_ACTIVE | RF_SHAREABLE);
- sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_solo softc");
+ mtx_init(&sc->lock, device_get_nameunit(dev), "snd_solo softc",
+ MTX_DEF);
return (sc->irq && sc->io && sc->sb && sc->vc &&
- sc->mpu && sc->gp && sc->lock)? 0 : ENXIO;
+ sc->mpu && sc->gp)? 0 : ENXIO;
}
static int