diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2011-02-10 17:26:12 +1300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-02-10 18:49:33 +0100 |
commit | d6f1c1c3646276c0784398d4ab31a9c307a6e15f (patch) | |
tree | 5a6624091216b7239d3f7990588b32a7b6cdf1b3 /sound/pci/asihpi | |
parent | fc3a399019a5a54258095c9bb0e17d4be5d51e67 (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>
Diffstat (limited to 'sound/pci/asihpi')
-rw-r--r-- | sound/pci/asihpi/hpicmn.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c index 4b3f4761cba..3e9c5c28976 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) } if (adapters.adapter[pao->index].adapter_type) { - { - retval = HPI_DUPLICATE_ADAPTER_NUMBER; + int a; + for (a = HPI_MAX_ADAPTERS - 1; a >= 0; a--) { + if (!adapters.adapter[a].adapter_type) { + HPI_DEBUG_LOG(WARNING, + "ASI%X duplicate index %d moved to %d\n", + pao->adapter_type, pao->index, a); + pao->index = a; + break; + } + } + if (a < 0) { + retval = HPI_ERROR_DUPLICATE_ADAPTER_NUMBER; goto unlock; } } |