Skip to content

Commit ee4023b

Browse files
morimototiwai
authored andcommitted
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
1 parent 2086e63 commit ee4023b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

sound/i2c/other/pt2258.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static int pt2258_stereo_volume_info(struct snd_kcontrol *kcontrol,
8080
static int pt2258_stereo_volume_get(struct snd_kcontrol *kcontrol,
8181
struct snd_ctl_elem_value *ucontrol)
8282
{
83-
struct snd_pt2258 *pt = kcontrol->private_data;
83+
struct snd_pt2258 *pt = snd_kcontrol_chip(kcontrol);
8484
int base = kcontrol->private_value;
8585

8686
/* chip does not support register reads */
@@ -92,7 +92,7 @@ static int pt2258_stereo_volume_get(struct snd_kcontrol *kcontrol,
9292
static int pt2258_stereo_volume_put(struct snd_kcontrol *kcontrol,
9393
struct snd_ctl_elem_value *ucontrol)
9494
{
95-
struct snd_pt2258 *pt = kcontrol->private_data;
95+
struct snd_pt2258 *pt = snd_kcontrol_chip(kcontrol);
9696
int base = kcontrol->private_value;
9797
unsigned char bytes[2];
9898
int val0, val1;
@@ -133,7 +133,7 @@ static int pt2258_stereo_volume_put(struct snd_kcontrol *kcontrol,
133133
static int pt2258_switch_get(struct snd_kcontrol *kcontrol,
134134
struct snd_ctl_elem_value *ucontrol)
135135
{
136-
struct snd_pt2258 *pt = kcontrol->private_data;
136+
struct snd_pt2258 *pt = snd_kcontrol_chip(kcontrol);
137137

138138
ucontrol->value.integer.value[0] = !pt->mute;
139139
return 0;
@@ -142,7 +142,7 @@ static int pt2258_switch_get(struct snd_kcontrol *kcontrol,
142142
static int pt2258_switch_put(struct snd_kcontrol *kcontrol,
143143
struct snd_ctl_elem_value *ucontrol)
144144
{
145-
struct snd_pt2258 *pt = kcontrol->private_data;
145+
struct snd_pt2258 *pt = snd_kcontrol_chip(kcontrol);
146146
unsigned char bytes[2];
147147
int val;
148148

0 commit comments

Comments
 (0)