diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-21 12:14:56 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-22 11:04:55 +0100 |
commit | 78cb4d995b932d9014342ddc81ce0a5cc434ed98 (patch) | |
tree | f29df7808f6b8482e251c0888d19eb2e4584156d | |
parent | ae11601b80b984859deda1f2d430a23bfabd3bea (diff) | |
download | op-kernel-dev-78cb4d995b932d9014342ddc81ce0a5cc434ed98.zip op-kernel-dev-78cb4d995b932d9014342ddc81ce0a5cc434ed98.tar.gz |
ASoC: core: Use snd_ctl_enum_info()
... and reduce the open codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/soc-core.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4c8f8a2..96ecdc3 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2348,16 +2348,8 @@ int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, { struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = e->shift_l == e->shift_r ? 1 : 2; - uinfo->value.enumerated.items = e->items; - - if (uinfo->value.enumerated.item >= e->items) - uinfo->value.enumerated.item = e->items - 1; - strlcpy(uinfo->value.enumerated.name, - e->texts[uinfo->value.enumerated.item], - sizeof(uinfo->value.enumerated.name)); - return 0; + return snd_ctl_enum_info(uinfo, e->shift_l == e->shift_r ? 1 : 2, + e->items, e->texts); } EXPORT_SYMBOL_GPL(snd_soc_info_enum_double); |