Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: i2c: use snd_kcontrol_chip()

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/87tt5xaudu.wl-kuninori.morimoto.gx@renesas.com

authored by

Kuninori Morimoto and committed by
Takashi Iwai
ee4023b1 2086e63b

+4 -4
+4 -4
sound/i2c/other/pt2258.c
··· 80 80 static int pt2258_stereo_volume_get(struct snd_kcontrol *kcontrol, 81 81 struct snd_ctl_elem_value *ucontrol) 82 82 { 83 - struct snd_pt2258 *pt = kcontrol->private_data; 83 + struct snd_pt2258 *pt = snd_kcontrol_chip(kcontrol); 84 84 int base = kcontrol->private_value; 85 85 86 86 /* chip does not support register reads */ ··· 92 92 static int pt2258_stereo_volume_put(struct snd_kcontrol *kcontrol, 93 93 struct snd_ctl_elem_value *ucontrol) 94 94 { 95 - struct snd_pt2258 *pt = kcontrol->private_data; 95 + struct snd_pt2258 *pt = snd_kcontrol_chip(kcontrol); 96 96 int base = kcontrol->private_value; 97 97 unsigned char bytes[2]; 98 98 int val0, val1; ··· 133 133 static int pt2258_switch_get(struct snd_kcontrol *kcontrol, 134 134 struct snd_ctl_elem_value *ucontrol) 135 135 { 136 - struct snd_pt2258 *pt = kcontrol->private_data; 136 + struct snd_pt2258 *pt = snd_kcontrol_chip(kcontrol); 137 137 138 138 ucontrol->value.integer.value[0] = !pt->mute; 139 139 return 0; ··· 142 142 static int pt2258_switch_put(struct snd_kcontrol *kcontrol, 143 143 struct snd_ctl_elem_value *ucontrol) 144 144 { 145 - struct snd_pt2258 *pt = kcontrol->private_data; 145 + struct snd_pt2258 *pt = snd_kcontrol_chip(kcontrol); 146 146 unsigned char bytes[2]; 147 147 int val; 148 148