ALSA: pci: asihpi: use snd_kcontrol_chip()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 7 May 2025 05:00:03 +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/87jz6taucs.wl-kuninori.morimoto.gx@renesas.com
sound/pci/asihpi/asihpi.c

index 65100f925b72f69197bc99914697b78bf12e87e9..7e5ce96954b9e91dba0620958604c3ce66ea0061 100644 (file)
@@ -2300,8 +2300,7 @@ static const char * const sampleclock_sources[] = {
 static int snd_asihpi_clksrc_info(struct snd_kcontrol *kcontrol,
                                  struct snd_ctl_elem_info *uinfo)
 {
-       struct snd_card_asihpi *asihpi =
-                       (struct snd_card_asihpi *)(kcontrol->private_data);
+       struct snd_card_asihpi *asihpi = snd_kcontrol_chip(kcontrol);
        struct clk_cache *clkcache = &asihpi->cc;
        uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
        uinfo->count = 1;
@@ -2319,8 +2318,7 @@ static int snd_asihpi_clksrc_info(struct snd_kcontrol *kcontrol,
 static int snd_asihpi_clksrc_get(struct snd_kcontrol *kcontrol,
                                 struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_card_asihpi *asihpi =
-                       (struct snd_card_asihpi *)(kcontrol->private_data);
+       struct snd_card_asihpi *asihpi = snd_kcontrol_chip(kcontrol);
        struct clk_cache *clkcache = &asihpi->cc;
        u32 h_control = kcontrol->private_value;
        u16 source, srcindex = 0;
@@ -2347,8 +2345,7 @@ static int snd_asihpi_clksrc_get(struct snd_kcontrol *kcontrol,
 static int snd_asihpi_clksrc_put(struct snd_kcontrol *kcontrol,
                                 struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_card_asihpi *asihpi =
-                       (struct snd_card_asihpi *)(kcontrol->private_data);
+       struct snd_card_asihpi *asihpi = snd_kcontrol_chip(kcontrol);
        struct clk_cache *clkcache = &asihpi->cc;
        unsigned int item;
        int change;