diff options
Diffstat (limited to 'sys/dev/sound/pci/solo.c')
| -rw-r--r-- | sys/dev/sound/pci/solo.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c index 8229b0cffdae..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); @@ -855,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); } @@ -887,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 |
