Skip to content

Commit f2f312a

Browse files
committed
ALSA: cmipci: Fix kctl->id initialization
cmipci driver replaces the kctl->id.device after assigning the kctl via snd_ctl_add(). This doesn't work any longer with the new Xarray lookup change. It has to be set before snd_ctl_add() call 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 c9b83ae commit f2f312a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/pci/cmipci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2688,20 +2688,20 @@ static int snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_device)
26882688
}
26892689
if (cm->can_ac3_hw) {
26902690
kctl = snd_ctl_new1(&snd_cmipci_spdif_default, cm);
2691+
kctl->id.device = pcm_spdif_device;
26912692
err = snd_ctl_add(card, kctl);
26922693
if (err < 0)
26932694
return err;
2694-
kctl->id.device = pcm_spdif_device;
26952695
kctl = snd_ctl_new1(&snd_cmipci_spdif_mask, cm);
2696+
kctl->id.device = pcm_spdif_device;
26962697
err = snd_ctl_add(card, kctl);
26972698
if (err < 0)
26982699
return err;
2699-
kctl->id.device = pcm_spdif_device;
27002700
kctl = snd_ctl_new1(&snd_cmipci_spdif_stream, cm);
2701+
kctl->id.device = pcm_spdif_device;
27012702
err = snd_ctl_add(card, kctl);
27022703
if (err < 0)
27032704
return err;
2704-
kctl->id.device = pcm_spdif_device;
27052705
}
27062706
if (cm->chip_version <= 37) {
27072707
sw = snd_cmipci_old_mixer_switches;

0 commit comments

Comments
 (0)