summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2008-12-25 00:58:16 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2008-12-25 00:58:16 +0000
commit8f0b5c7ac3f2706274ec499368bee4d955f7e90f (patch)
tree70d349264531bd2e10f75971ec0246a88de7f64d /sys/dev
parentac9c0595ca320fce402857173c2894849b75cecb (diff)
before naming a widget after a pin because the widget is the only thing
the pin is connected to, make sure the pin is the only device that is connected to the widget.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/azalia.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
index a962056c5bc..acbf4ccd9ba 100644
--- a/sys/dev/pci/azalia.c
+++ b/sys/dev/pci/azalia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: azalia.c,v 1.94 2008/12/25 00:20:36 jakemsr Exp $ */
+/* $OpenBSD: azalia.c,v 1.95 2008/12/25 00:58:15 jakemsr Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
@@ -1688,14 +1688,20 @@ azalia_widget_sole_conn(codec_t *this, nid_t nid)
}
}
/* connected to pin complex */
+ j = -1;
FOR_EACH_WIDGET(this, i) {
if (this->w[i].type == COP_AWTYPE_PIN_COMPLEX &&
this->w[i].nconnections == 1 &&
this->w[i].connections[0] == nid &&
azalia_widget_enabled(this, this->w[i].connections[0])) {
- return i;
+ if (j != -1)
+ return -1;
+ j = i;
}
}
+ if (j != -1)
+ return j;
+
return -1;
}