aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pci/ich.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/pci/ich.c')
-rw-r--r--sys/dev/sound/pci/ich.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c
index 53f4db3332a8..7e7fe95dac8c 100644
--- a/sys/dev/sound/pci/ich.c
+++ b/sys/dev/sound/pci/ich.c
@@ -77,9 +77,9 @@
#define AMD_768 0x7445
#define AMD_8111 0x746d
-#define ICH_LOCK(sc) snd_mtxlock((sc)->ich_lock)
-#define ICH_UNLOCK(sc) snd_mtxunlock((sc)->ich_lock)
-#define ICH_LOCK_ASSERT(sc) snd_mtxassert((sc)->ich_lock)
+#define ICH_LOCK(sc) mtx_lock(&(sc)->ich_lock)
+#define ICH_UNLOCK(sc) mtx_unlock(&(sc)->ich_lock)
+#define ICH_LOCK_ASSERT(sc) mtx_assert(&(sc)->ich_lock, MA_OWNED)
#if 0
#define ICH_DEBUG(stmt) do { \
@@ -196,7 +196,7 @@ struct sc_info {
uint16_t vendor;
uint16_t devid;
uint32_t flags;
- struct mtx *ich_lock;
+ struct mtx ich_lock;
};
/* -------------------------------------------------------------------- */
@@ -888,7 +888,8 @@ ich_pci_attach(device_t dev)
int i;
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
- sc->ich_lock = snd_mtxcreate(device_get_nameunit(dev), "snd_ich softc");
+ mtx_init(&sc->ich_lock, device_get_nameunit(dev), "snd_ich softc",
+ MTX_DEF);
sc->dev = dev;
vendor = sc->vendor = pci_get_vendor(dev);
@@ -1111,8 +1112,7 @@ bad:
bus_dma_tag_destroy(sc->chan_dmat);
if (sc->dmat)
bus_dma_tag_destroy(sc->dmat);
- if (sc->ich_lock)
- snd_mtxfree(sc->ich_lock);
+ mtx_destroy(&sc->ich_lock);
free(sc, M_DEVBUF);
return (ENXIO);
}
@@ -1136,7 +1136,7 @@ ich_pci_detach(device_t dev)
bus_dmamem_free(sc->dmat, sc->dtbl, sc->dtmap);
bus_dma_tag_destroy(sc->chan_dmat);
bus_dma_tag_destroy(sc->dmat);
- snd_mtxfree(sc->ich_lock);
+ mtx_destroy(&sc->ich_lock);
free(sc, M_DEVBUF);
return (0);
}