summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2018-06-24 23:54:22 +0000
committerratchov <ratchov@openbsd.org>2018-06-24 23:54:22 +0000
commit2af2674bdba41848b899a3f9f672e5c309e5c473 (patch)
tree704600be55ec45cd75ef4a7473e8c08f1148a222
parentMinor cosmetic improvement from KOIE Hidetaka. (diff)
downloadwireguard-openbsd-2af2674bdba41848b899a3f9f672e5c309e5c473.tar.xz
wireguard-openbsd-2af2674bdba41848b899a3f9f672e5c309e5c473.zip
Save all mixer elements in the suspend/resume array instead of only
enum, sets, and values. This is simpler and less error prone. This fixes the record.enable elements replacing the last few hardware mixer controls. Help from Laurence Tratt, tested by landry@
-rw-r--r--sys/dev/audio.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 7bd6247d9a4..840764a2e88 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.171 2018/05/26 10:16:13 ratchov Exp $ */
+/* $OpenBSD: audio.c,v 1.172 2018/06/24 23:54:22 ratchov Exp $ */
/*
* Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org>
*
@@ -1088,20 +1088,13 @@ audio_attach(struct device *parent, struct device *self, void *aux)
mi = malloc(sizeof(struct mixer_devinfo), M_TEMP, M_WAITOK);
- sc->mix_nent = 0;
mi->index = 0;
while (1) {
if (sc->ops->query_devinfo(sc->arg, mi) != 0)
break;
- switch (mi->type) {
- case AUDIO_MIXER_SET:
- case AUDIO_MIXER_ENUM:
- case AUDIO_MIXER_VALUE:
- sc->mix_nent++;
- }
mi->index++;
}
-
+ sc->mix_nent = mi->index;
sc->mix_ents = mallocarray(sc->mix_nent,
sizeof(struct mixer_ctrl), M_DEVBUF, M_WAITOK);
@@ -1118,9 +1111,9 @@ audio_attach(struct device *parent, struct device *self, void *aux)
case AUDIO_MIXER_ENUM:
ent->dev = mi->index;
ent->type = mi->type;
- ent++;
}
mi->index++;
+ ent++;
}
free(mi, M_TEMP, sizeof(struct mixer_devinfo));