ALSA: sh: use snd_kcontrol_chip()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 7 May 2025 04:59:15 +0000 (04:59 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 8 May 2025 09:53:34 +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/87v7qdaue4.wl-kuninori.morimoto.gx@renesas.com
sound/sh/aica.c

index 5a93f458735632d433907195e6f09a2d83e01f51..f88331a48638174d2ae25cbe6e2233126aec9001 100644 (file)
@@ -469,8 +469,8 @@ static int aica_pcmvolume_info(struct snd_kcontrol *kcontrol,
 static int aica_pcmvolume_get(struct snd_kcontrol *kcontrol,
                              struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_card_aica *dreamcastcard;
-       dreamcastcard = kcontrol->private_data;
+       struct snd_card_aica *dreamcastcard = snd_kcontrol_chip(kcontrol);
+
        if (unlikely(!dreamcastcard->channel))
                return -ETXTBSY;        /* we've not yet been set up */
        ucontrol->value.integer.value[0] = dreamcastcard->channel->vol;
@@ -480,9 +480,9 @@ static int aica_pcmvolume_get(struct snd_kcontrol *kcontrol,
 static int aica_pcmvolume_put(struct snd_kcontrol *kcontrol,
                              struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_card_aica *dreamcastcard;
+       struct snd_card_aica *dreamcastcard = snd_kcontrol_chip(kcontrol);
        unsigned int vol;
-       dreamcastcard = kcontrol->private_data;
+
        if (unlikely(!dreamcastcard->channel))
                return -ETXTBSY;
        vol = ucontrol->value.integer.value[0];