ALSA: pci: ali5451: use snd_kcontrol_chip()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 7 May 2025 05:00:08 +0000 (05:00 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 8 May 2025 09:53:35 +0000 (11:53 +0200)
We can use snd_kcontrol_chip(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/87ikmdauco.wl-kuninori.morimoto.gx@renesas.com
sound/pci/ali5451/ali5451.c

index 5f38a60467c1b5be39b18cd146e30bd2775560bc..69c02bdd38ce1a2870815e68c4233a2e0ac5eea9 100644 (file)
@@ -1688,7 +1688,7 @@ static int snd_ali_build_pcms(struct snd_ali *codec)
 static int snd_ali5451_spdif_get(struct snd_kcontrol *kcontrol,
                                 struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_ali *codec = kcontrol->private_data;
+       struct snd_ali *codec = snd_kcontrol_chip(kcontrol);
        unsigned int spdif_enable;
 
        spdif_enable = ucontrol->value.integer.value[0] ? 1 : 0;
@@ -1716,7 +1716,7 @@ static int snd_ali5451_spdif_get(struct snd_kcontrol *kcontrol,
 static int snd_ali5451_spdif_put(struct snd_kcontrol *kcontrol,
                                 struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_ali *codec = kcontrol->private_data;
+       struct snd_ali *codec = snd_kcontrol_chip(kcontrol);
        unsigned int change = 0, spdif_enable = 0;
 
        spdif_enable = ucontrol->value.integer.value[0] ? 1 : 0;