From 750f20683713fb6c2bff7be2196d6211380d26b8 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Fri, 15 Aug 2008 11:22:59 +0000 Subject: [PATCH] Skip unconnected pins when creating a selector connlist. --- sys/dev/pci/azalia_codec.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c index 451be57361b7..e69e518b1aff 100644 --- a/sys/dev/pci/azalia_codec.c +++ b/sys/dev/pci/azalia_codec.c @@ -1,4 +1,4 @@ -/* $NetBSD: azalia_codec.c,v 1.68 2008/08/14 23:43:27 jmcneill Exp $ */ +/* $NetBSD: azalia_codec.c,v 1.69 2008/08/15 11:22:59 jmcneill Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.68 2008/08/14 23:43:27 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: azalia_codec.c,v 1.69 2008/08/15 11:22:59 jmcneill Exp $"); #include #include @@ -639,8 +639,15 @@ generic_mixer_init(codec_t *this) d->mixer_class = AZ_CLASS_OUTPUT; m->target = MI_TARGET_CONNLIST; for (j = 0, k = 0; j < w->nconnections && k < 32; j++) { + uint8_t conn; + if (!VALID_WIDGET_NID(w->connections[j], this)) continue; + /* skip unconnected pins */ + PIN_STATUS(&this->w[w->connections[j]], + conn); + if (conn == 1) + continue; GMIDPRINTF(("%s: selector %d=%s\n", __func__, j, this->w[w->connections[j]].name)); d->un.e.member[k].ord = j;