Skip to content

Commit 792f318

Browse files
morimototiwai
authored andcommitted
ALSA: virtio: 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/87r011audg.wl-kuninori.morimoto.gx@renesas.com
1 parent a6e8ecb commit 792f318

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

sound/virtio/virtio_kctl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static const unsigned int g_v2a_mask_map[] = {
4747
static int virtsnd_kctl_info(struct snd_kcontrol *kcontrol,
4848
struct snd_ctl_elem_info *uinfo)
4949
{
50-
struct virtio_snd *snd = kcontrol->private_data;
50+
struct virtio_snd *snd = snd_kcontrol_chip(kcontrol);
5151
struct virtio_kctl *kctl = &snd->kctls[kcontrol->private_value];
5252
struct virtio_snd_ctl_info *kinfo =
5353
&snd->kctl_infos[kcontrol->private_value];
@@ -102,7 +102,7 @@ static int virtsnd_kctl_info(struct snd_kcontrol *kcontrol,
102102
static int virtsnd_kctl_get(struct snd_kcontrol *kcontrol,
103103
struct snd_ctl_elem_value *uvalue)
104104
{
105-
struct virtio_snd *snd = kcontrol->private_data;
105+
struct virtio_snd *snd = snd_kcontrol_chip(kcontrol);
106106
struct virtio_snd_ctl_info *kinfo =
107107
&snd->kctl_infos[kcontrol->private_value];
108108
unsigned int type = le32_to_cpu(kinfo->type);
@@ -175,7 +175,7 @@ static int virtsnd_kctl_get(struct snd_kcontrol *kcontrol,
175175
static int virtsnd_kctl_put(struct snd_kcontrol *kcontrol,
176176
struct snd_ctl_elem_value *uvalue)
177177
{
178-
struct virtio_snd *snd = kcontrol->private_data;
178+
struct virtio_snd *snd = snd_kcontrol_chip(kcontrol);
179179
struct virtio_snd_ctl_info *kinfo =
180180
&snd->kctl_infos[kcontrol->private_value];
181181
unsigned int type = le32_to_cpu(kinfo->type);
@@ -239,7 +239,7 @@ static int virtsnd_kctl_put(struct snd_kcontrol *kcontrol,
239239
static int virtsnd_kctl_tlv_op(struct snd_kcontrol *kcontrol, int op_flag,
240240
unsigned int size, unsigned int __user *utlv)
241241
{
242-
struct virtio_snd *snd = kcontrol->private_data;
242+
struct virtio_snd *snd = snd_kcontrol_chip(kcontrol);
243243
struct virtio_snd_msg *msg;
244244
struct virtio_snd_ctl_hdr *hdr;
245245
unsigned int *tlv;

0 commit comments

Comments
 (0)