aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pci/hda
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sound/pci/hda')
-rw-r--r--sys/dev/sound/pci/hda/hdaa.c6
-rw-r--r--sys/dev/sound/pci/hda/hdac.c15
-rw-r--r--sys/dev/sound/pci/hda/hdac_private.h2
-rw-r--r--sys/dev/sound/pci/hda/hdacc.c6
4 files changed, 15 insertions, 14 deletions
diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c
index 14231107e17a..7dec437de944 100644
--- a/sys/dev/sound/pci/hda/hdaa.c
+++ b/sys/dev/sound/pci/hda/hdaa.c
@@ -47,9 +47,9 @@
#include "mixer_if.h"
-#define hdaa_lock(devinfo) snd_mtxlock((devinfo)->lock)
-#define hdaa_unlock(devinfo) snd_mtxunlock((devinfo)->lock)
-#define hdaa_lockassert(devinfo) snd_mtxassert((devinfo)->lock)
+#define hdaa_lock(devinfo) mtx_lock((devinfo)->lock)
+#define hdaa_unlock(devinfo) mtx_unlock((devinfo)->lock)
+#define hdaa_lockassert(devinfo) mtx_assert((devinfo)->lock, MA_OWNED)
static const struct {
const char *key;
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
index 8a325c538b9b..d1de81e7ba29 100644
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -51,9 +51,9 @@
#define HDA_DRV_TEST_REV "20120126_0002"
-#define hdac_lock(sc) snd_mtxlock((sc)->lock)
-#define hdac_unlock(sc) snd_mtxunlock((sc)->lock)
-#define hdac_lockassert(sc) snd_mtxassert((sc)->lock)
+#define hdac_lock(sc) mtx_lock(&(sc)->lock)
+#define hdac_unlock(sc) mtx_unlock(&(sc)->lock)
+#define hdac_lockassert(sc) mtx_assert(&(sc)->lock, MA_OWNED)
#define HDAC_QUIRK_64BIT (1 << 0)
#define HDAC_QUIRK_DMAPOS (1 << 1)
@@ -1171,7 +1171,8 @@ hdac_attach(device_t dev)
}
}
- sc->lock = snd_mtxcreate(device_get_nameunit(dev), "HDA driver mutex");
+ mtx_init(&sc->lock, device_get_nameunit(dev), "HDA driver mutex",
+ MTX_DEF);
sc->dev = dev;
TASK_INIT(&sc->unsolq_task, 0, hdac_unsolq_task, sc);
callout_init(&sc->poll_callout, 1);
@@ -1374,7 +1375,7 @@ hdac_attach_fail:
hdac_dma_free(sc, &sc->rirb_dma);
hdac_dma_free(sc, &sc->corb_dma);
hdac_mem_free(sc);
- snd_mtxfree(sc->lock);
+ mtx_destroy(&sc->lock);
return (ENXIO);
}
@@ -1798,7 +1799,7 @@ hdac_detach(device_t dev)
sc->chan_dmat = NULL;
}
hdac_mem_free(sc);
- snd_mtxfree(sc->lock);
+ mtx_destroy(&sc->lock);
return (0);
}
@@ -1888,7 +1889,7 @@ hdac_get_mtx(device_t dev, device_t child)
{
struct hdac_softc *sc = device_get_softc(dev);
- return (sc->lock);
+ return (&sc->lock);
}
static uint32_t
diff --git a/sys/dev/sound/pci/hda/hdac_private.h b/sys/dev/sound/pci/hda/hdac_private.h
index c434bface240..0c6fe41fd5de 100644
--- a/sys/dev/sound/pci/hda/hdac_private.h
+++ b/sys/dev/sound/pci/hda/hdac_private.h
@@ -162,7 +162,7 @@ struct hdac_stream {
struct hdac_softc {
device_t dev;
- struct mtx *lock;
+ struct mtx lock;
struct intr_config_hook intrhook;
diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c
index 4198982c9c2a..b001daa549b1 100644
--- a/sys/dev/sound/pci/hda/hdacc.c
+++ b/sys/dev/sound/pci/hda/hdacc.c
@@ -60,9 +60,9 @@ struct hdacc_softc {
struct hdacc_fg *fgs;
};
-#define hdacc_lock(codec) snd_mtxlock((codec)->lock)
-#define hdacc_unlock(codec) snd_mtxunlock((codec)->lock)
-#define hdacc_lockassert(codec) snd_mtxassert((codec)->lock)
+#define hdacc_lock(codec) mtx_lock((codec)->lock)
+#define hdacc_unlock(codec) mtx_unlock((codec)->lock)
+#define hdacc_lockassert(codec) mtx_assert((codec)->lock, MA_OWNED)
MALLOC_DEFINE(M_HDACC, "hdacc", "HDA CODEC");