mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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
This commit is contained in:
parent
ee4023b1ed
commit
a6e8ecb2fb
1 changed files with 7 additions and 7 deletions
|
@ -1405,7 +1405,7 @@ static bool check_user_elem_overflow(struct snd_card *card, ssize_t add)
|
|||
static int snd_ctl_elem_user_info(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
struct user_element *ue = kcontrol->private_data;
|
||||
struct user_element *ue = snd_kcontrol_chip(kcontrol);
|
||||
unsigned int offset;
|
||||
|
||||
offset = snd_ctl_get_ioff(kcontrol, &uinfo->id);
|
||||
|
@ -1418,7 +1418,7 @@ static int snd_ctl_elem_user_info(struct snd_kcontrol *kcontrol,
|
|||
static int snd_ctl_elem_user_enum_info(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
struct user_element *ue = kcontrol->private_data;
|
||||
struct user_element *ue = snd_kcontrol_chip(kcontrol);
|
||||
const char *names;
|
||||
unsigned int item;
|
||||
unsigned int offset;
|
||||
|
@ -1443,7 +1443,7 @@ static int snd_ctl_elem_user_enum_info(struct snd_kcontrol *kcontrol,
|
|||
static int snd_ctl_elem_user_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct user_element *ue = kcontrol->private_data;
|
||||
struct user_element *ue = snd_kcontrol_chip(kcontrol);
|
||||
unsigned int size = ue->elem_data_size;
|
||||
char *src = ue->elem_data +
|
||||
snd_ctl_get_ioff(kcontrol, &ucontrol->id) * size;
|
||||
|
@ -1456,7 +1456,7 @@ static int snd_ctl_elem_user_put(struct snd_kcontrol *kcontrol,
|
|||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
int err, change;
|
||||
struct user_element *ue = kcontrol->private_data;
|
||||
struct user_element *ue = snd_kcontrol_chip(kcontrol);
|
||||
unsigned int size = ue->elem_data_size;
|
||||
char *dst = ue->elem_data +
|
||||
snd_ctl_get_ioff(kcontrol, &ucontrol->id) * size;
|
||||
|
@ -1475,7 +1475,7 @@ static int snd_ctl_elem_user_put(struct snd_kcontrol *kcontrol,
|
|||
static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
|
||||
unsigned int size)
|
||||
{
|
||||
struct user_element *ue = kctl->private_data;
|
||||
struct user_element *ue = snd_kcontrol_chip(kctl);
|
||||
unsigned int *container;
|
||||
unsigned int mask = 0;
|
||||
int i;
|
||||
|
@ -1528,7 +1528,7 @@ static int replace_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
|
|||
static int read_user_tlv(struct snd_kcontrol *kctl, unsigned int __user *buf,
|
||||
unsigned int size)
|
||||
{
|
||||
struct user_element *ue = kctl->private_data;
|
||||
struct user_element *ue = snd_kcontrol_chip(kctl);
|
||||
|
||||
if (ue->tlv_data_size == 0 || ue->tlv_data == NULL)
|
||||
return -ENXIO;
|
||||
|
@ -1598,7 +1598,7 @@ static size_t compute_user_elem_size(size_t size, unsigned int count)
|
|||
|
||||
static void snd_ctl_elem_user_free(struct snd_kcontrol *kcontrol)
|
||||
{
|
||||
struct user_element *ue = kcontrol->private_data;
|
||||
struct user_element *ue = snd_kcontrol_chip(kcontrol);
|
||||
|
||||
// decrement the allocation size.
|
||||
ue->card->user_ctl_alloc_size -= compute_user_elem_size(ue->elem_data_size, kcontrol->count);
|
||||
|
|
Loading…
Add table
Reference in a new issue