diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2011-02-10 05:26:12 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-02-10 18:49:33 +0100 |
commit | d6f1c1c3646276c0784398d4ab31a9c307a6e15f (patch) | |
tree | 5a6624091216b7239d3f7990588b32a7b6cdf1b3 /sound/pci/asihpi/hpicmn.c | |
parent | ALSA: asihpi - Add volume mute control. (diff) | |
download | linux-d6f1c1c3646276c0784398d4ab31a9c307a6e15f.tar.xz linux-d6f1c1c3646276c0784398d4ab31a9c307a6e15f.zip |
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/hpicmn.c')
-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; } } |