aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliot Blennerhassett <eblennerhassett@audioscience.com>2011-02-09 23:26:12 -0500
committerTakashi Iwai <tiwai@suse.de>2011-02-10 12:49:33 -0500
commitd6f1c1c3646276c0784398d4ab31a9c307a6e15f (patch)
tree5a6624091216b7239d3f7990588b32a7b6cdf1b3
parentfc3a399019a5a54258095c9bb0e17d4be5d51e67 (diff)
ALSA: asihpi - Allow adapters with duplicate index jumpers to be discovered.
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/asihpi/hpicmn.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c
index 4b3f4761cba5..3e9c5c289764 100644
--- a/sound/pci/asihpi/hpicmn.c
+++ b/sound/pci/asihpi/hpicmn.c
@@ -78,8 +78,18 @@ u16 hpi_add_adapter(struct hpi_adapter_obj *pao)
78 } 78 }
79 79
80 if (adapters.adapter[pao->index].adapter_type) { 80 if (adapters.adapter[pao->index].adapter_type) {
81 { 81 int a;
82 retval = HPI_DUPLICATE_ADAPTER_NUMBER; 82 for (a = HPI_MAX_ADAPTERS - 1; a >= 0; a--) {
83 if (!adapters.adapter[a].adapter_type) {
84 HPI_DEBUG_LOG(WARNING,
85 "ASI%X duplicate index %d moved to %d\n",
86 pao->adapter_type, pao->index, a);
87 pao->index = a;
88 break;
89 }
90 }
91 if (a < 0) {
92 retval = HPI_ERROR_DUPLICATE_ADAPTER_NUMBER;
83 goto unlock; 93 goto unlock;
84 } 94 }
85 } 95 }