diff options
Diffstat (limited to 'sys/dev/sound/pci/es137x.c')
| -rw-r--r-- | sys/dev/sound/pci/es137x.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index 6b2093e16246..cc51005309b0 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -224,14 +224,14 @@ struct es_info { uint32_t sctrl; uint32_t escfg; struct es_chinfo ch[ES_NCHANS]; - struct mtx *lock; + struct mtx lock; struct callout poll_timer; int poll_ticks, polling; }; -#define ES_LOCK(sc) snd_mtxlock((sc)->lock) -#define ES_UNLOCK(sc) snd_mtxunlock((sc)->lock) -#define ES_LOCK_ASSERT(sc) snd_mtxassert((sc)->lock) +#define ES_LOCK(sc) mtx_lock(&(sc)->lock) +#define ES_UNLOCK(sc) mtx_unlock(&(sc)->lock) +#define ES_LOCK_ASSERT(sc) mtx_assert(&(sc)->lock, MA_OWNED) /* prototypes */ static void es_intr(void *); @@ -1712,7 +1712,8 @@ es_pci_attach(device_t dev) uint32_t devid; es = malloc(sizeof *es, M_DEVBUF, M_WAITOK | M_ZERO); - es->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_es137x softc"); + mtx_init(&es->lock, device_get_nameunit(dev), "snd_es137x softc", + MTX_DEF); es->dev = dev; es->escfg = 0; mapped = 0; @@ -1888,8 +1889,7 @@ bad: ac97_destroy(codec); if (es->reg) bus_release_resource(dev, es->regtype, es->regid, es->reg); - if (es->lock) - snd_mtxfree(es->lock); + mtx_destroy(&es->lock); if (es) free(es, M_DEVBUF); return (ENXIO); @@ -1919,7 +1919,7 @@ es_pci_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, es->irqid, es->irq); bus_release_resource(dev, es->regtype, es->regid, es->reg); bus_dma_tag_destroy(es->parent_dmat); - snd_mtxfree(es->lock); + mtx_destroy(&es->lock); free(es, M_DEVBUF); return (0); |
