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

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: core: 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/87selhaudp.wl-kuninori.morimoto.gx@renesas.com

authored by

Kuninori Morimoto and committed by
Takashi Iwai
a6e8ecb2 ee4023b1

+7 -7
+7 -7
sound/core/control.c
··· 1405 1405 static int snd_ctl_elem_user_info(struct snd_kcontrol *kcontrol, 1406 1406 struct snd_ctl_elem_info *uinfo) 1407 1407 { 1408 - struct user_element *ue = kcontrol->private_data; 1408 + struct user_element *ue = snd_kcontrol_chip(kcontrol); 1409 1409 unsigned int offset; 1410 1410 1411 1411 offset = snd_ctl_get_ioff(kcontrol, &uinfo->id); ··· 1418 1418 static int snd_ctl_elem_user_enum_info(struct snd_kcontrol *kcontrol, 1419 1419 struct snd_ctl_elem_info *uinfo) 1420 1420 { 1421 - struct user_element *ue = kcontrol->private_data; 1421 + struct user_element *ue = snd_kcontrol_chip(kcontrol); 1422 1422 const char *names; 1423 1423 unsigned int item; 1424 1424 unsigned int offset; ··· 1443 1443 static int snd_ctl_elem_user_get(struct snd_kcontrol *kcontrol, 1444 1444 struct snd_ctl_elem_value *ucontrol) 1445 1445 { 1446 - struct user_element *ue = kcontrol->private_data; 1446 + struct user_element *ue = snd_kcontrol_chip(kcontrol); 1447 1447 unsigned int size = ue->elem_data_size; 1448 1448 char *src = ue->elem_data + 1449 1449 snd_ctl_get_ioff(kcontrol, &ucontrol->id) * size; ··· 1456 1456 struct snd_ctl_elem_value *ucontrol) 1457 1457 { 1458 1458 int err, change; 1459 - struct user_element *ue = kcontrol->private_data; 1459 + struct user_element *ue = snd_kcontrol_chip(kcontrol); 1460 1460 unsigned int size = ue->elem_data_size; 1461 1461 char *dst = ue->elem_data + 1462 1462 snd_ctl_get_ioff(kcontrol, &ucontrol->id) * size; ··· 1475 1475 static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf, 1476 1476 unsigned int size) 1477 1477 { 1478 - struct user_element *ue = kctl->private_data; 1478 + struct user_element *ue = snd_kcontrol_chip(kctl); 1479 1479 unsigned int *container; 1480 1480 unsigned int mask = 0; 1481 1481 int i; ··· 1528 1528 static int read_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf, 1529 1529 unsigned int size) 1530 1530 { 1531 - struct user_element *ue = kctl->private_data; 1531 + struct user_element *ue = snd_kcontrol_chip(kctl); 1532 1532 1533 1533 if (ue->tlv_data_size == 0 || ue->tlv_data == NULL) 1534 1534 return -ENXIO; ··· 1598 1598 1599 1599 static void snd_ctl_elem_user_free(struct snd_kcontrol *kcontrol) 1600 1600 { 1601 - struct user_element *ue = kcontrol->private_data; 1601 + struct user_element *ue = snd_kcontrol_chip(kcontrol); 1602 1602 1603 1603 // decrement the allocation size. 1604 1604 ue->card->user_ctl_alloc_size -= compute_user_elem_size(ue->elem_data_size, kcontrol->count);