Skip to content

Commit 5c219a3

Browse files
committed
ALSA: hda: Fix kctl->id initialization
HD-audio core code replaces the kctl->id.index of SPDIF-related controls after assigning via snd_ctl_add(). This doesn't work any longer with the new Xarray lookup change. The change of the kctl->id content has to be done via snd_ctl_rename_id() helper, instead. Fixes: c27e1ef ("ALSA: control: Use xarray for faster lookups") Cc: <[email protected]> Reviewed-by: Jaroslav Kysela <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent c5ae57b commit 5c219a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sound/pci/hda/hda_codec.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2458,10 +2458,14 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec,
24582458
type == HDA_PCM_TYPE_HDMI) {
24592459
/* suppose a single SPDIF device */
24602460
for (dig_mix = dig_mixes; dig_mix->name; dig_mix++) {
2461+
struct snd_ctl_elem_id id;
2462+
24612463
kctl = find_mixer_ctl(codec, dig_mix->name, 0, 0);
24622464
if (!kctl)
24632465
break;
2464-
kctl->id.index = spdif_index;
2466+
id = kctl->id;
2467+
id.index = spdif_index;
2468+
snd_ctl_rename_id(codec->card, &kctl->id, &id);
24652469
}
24662470
bus->primary_dig_out_type = HDA_PCM_TYPE_HDMI;
24672471
}

0 commit comments

Comments
 (0)