Skip to content

Commit 483dd12

Browse files
morimototiwai
authored andcommitted
ALSA: pci: hda: 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/87plglauda.wl-kuninori.morimoto.gx@renesas.com
1 parent 792f318 commit 483dd12

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

sound/pci/hda/cs35l56_hda.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static int cs35l56_hda_mixer_info(struct snd_kcontrol *kcontrol,
179179
static int cs35l56_hda_mixer_get(struct snd_kcontrol *kcontrol,
180180
struct snd_ctl_elem_value *ucontrol)
181181
{
182-
struct cs35l56_hda *cs35l56 = (struct cs35l56_hda *)kcontrol->private_data;
182+
struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol);
183183
unsigned int reg_val;
184184
int i;
185185

@@ -201,7 +201,7 @@ static int cs35l56_hda_mixer_get(struct snd_kcontrol *kcontrol,
201201
static int cs35l56_hda_mixer_put(struct snd_kcontrol *kcontrol,
202202
struct snd_ctl_elem_value *ucontrol)
203203
{
204-
struct cs35l56_hda *cs35l56 = (struct cs35l56_hda *)kcontrol->private_data;
204+
struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol);
205205
unsigned int item = ucontrol->value.enumerated.item[0];
206206
bool changed;
207207

@@ -230,7 +230,7 @@ static int cs35l56_hda_posture_info(struct snd_kcontrol *kcontrol,
230230
static int cs35l56_hda_posture_get(struct snd_kcontrol *kcontrol,
231231
struct snd_ctl_elem_value *ucontrol)
232232
{
233-
struct cs35l56_hda *cs35l56 = (struct cs35l56_hda *)kcontrol->private_data;
233+
struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol);
234234
unsigned int pos;
235235
int ret;
236236

@@ -248,7 +248,7 @@ static int cs35l56_hda_posture_get(struct snd_kcontrol *kcontrol,
248248
static int cs35l56_hda_posture_put(struct snd_kcontrol *kcontrol,
249249
struct snd_ctl_elem_value *ucontrol)
250250
{
251-
struct cs35l56_hda *cs35l56 = (struct cs35l56_hda *)kcontrol->private_data;
251+
struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol);
252252
unsigned long pos = ucontrol->value.integer.value[0];
253253
bool changed;
254254
int ret;
@@ -297,7 +297,7 @@ static int cs35l56_hda_vol_info(struct snd_kcontrol *kcontrol,
297297
static int cs35l56_hda_vol_get(struct snd_kcontrol *kcontrol,
298298
struct snd_ctl_elem_value *ucontrol)
299299
{
300-
struct cs35l56_hda *cs35l56 = (struct cs35l56_hda *)kcontrol->private_data;
300+
struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol);
301301
unsigned int raw_vol;
302302
int vol;
303303
int ret;
@@ -323,7 +323,7 @@ static int cs35l56_hda_vol_get(struct snd_kcontrol *kcontrol,
323323
static int cs35l56_hda_vol_put(struct snd_kcontrol *kcontrol,
324324
struct snd_ctl_elem_value *ucontrol)
325325
{
326-
struct cs35l56_hda *cs35l56 = (struct cs35l56_hda *)kcontrol->private_data;
326+
struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol);
327327
long vol = ucontrol->value.integer.value[0];
328328
unsigned int raw_vol;
329329
bool changed;

0 commit comments

Comments
 (0)