diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2011-02-10 07:26:12 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-02-10 20:49:33 +0300 |
commit | d6f1c1c3646276c0784398d4ab31a9c307a6e15f (patch) | |
tree | 5a6624091216b7239d3f7990588b32a7b6cdf1b3 /sound | |
parent | fc3a399019a5a54258095c9bb0e17d4be5d51e67 (diff) | |
download | linux-d6f1c1c3646276c0784398d4ab31a9c307a6e15f.tar.xz |
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')
-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 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) } 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; } } |