summaryrefslogtreecommitdiff
path: root/sys/dev/pci/azalia_codec.c
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2008-11-28 09:58:19 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2008-11-28 09:58:19 +0000
commit75a5099da8a322d1fdb4ebd97cb087ed560aee70 (patch)
tree8ca9886b4f0cac3977a35084ce2dc9f51fc36656 /sys/dev/pci/azalia_codec.c
parentceeec80be9d7ac492fa5f816ad7d9de16a452341 (diff)
- remove a couple unneeded checks
- another place to use azalia_nid_to_index
Diffstat (limited to 'sys/dev/pci/azalia_codec.c')
-rw-r--r--sys/dev/pci/azalia_codec.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c
index 7767111f4cc..0e536fe032f 100644
--- a/sys/dev/pci/azalia_codec.c
+++ b/sys/dev/pci/azalia_codec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia_codec.c,v 1.72 2008/11/28 04:03:37 jakemsr Exp $ */
+/* $OpenBSD: azalia_codec.c,v 1.73 2008/11/28 09:58:18 jakemsr Exp $ */
/* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */
/*-
@@ -378,8 +378,7 @@ azalia_generic_codec_add_convgroup(codec_t *this, convgroupset_t *group,
if (type == COP_AWTYPE_AUDIO_OUTPUT) {
k = azalia_generic_codec_fnode
(this, conv, i, 0);
- if (k < 0 ||
- this->w[k].nid != conv)
+ if (k < 0)
continue;
} else {
l = azalia_nid_to_index(this,
@@ -388,8 +387,7 @@ azalia_generic_codec_add_convgroup(codec_t *this, convgroupset_t *group,
continue;
k = azalia_generic_codec_fnode
(this, w->nid, l, 0);
- if (k < 0 || this->w[k].nid !=
- w->nid)
+ if (k < 0)
continue;
}
convs[nconvs++] = conv;
@@ -707,18 +705,14 @@ azalia_generic_mixer_init(codec_t *this)
this->nmixers++;
} else {
for (j = 0; j < w->nconnections; j++) {
- const widget_t *ww;
-
- MIXER_REG_PROLOG;
- if (!VALID_WIDGET_NID(w->connections[j],
- this))
- continue;
- ww = &this->w[w->connections[j]];
- if (!ww->enable)
+ k = azalia_nid_to_index(this,
+ w->connections[j]);
+ if (k == -1)
continue;
- snprintf(d->label.name, sizeof(d->label.name),
- "%s_%s", w->name,
- this->w[w->connections[j]].name);
+ MIXER_REG_PROLOG;
+ snprintf(d->label.name,
+ sizeof(d->label.name), "%s_%s",
+ w->name, this->w[k].name);
d->type = AUDIO_MIXER_VALUE;
if (w->type == COP_AWTYPE_AUDIO_INPUT)
d->mixer_class = AZ_CLASS_RECORD;