summaryrefslogtreecommitdiffstats
path: root/sound/aoa/codecs/onyx.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-20 18:10:39 +0200
committerTakashi Iwai <tiwai@suse.de>2014-10-21 08:08:36 +0200
commit04eeb606a8383b306f4bc6991da8231b5f3924b0 (patch)
tree945d33b8cc10893697608ba4b4192cde78700ca7 /sound/aoa/codecs/onyx.c
parenta7e6fb99150ebb2852ebd0e7bad9ce37cc9a79dd (diff)
downloadlinux-04eeb606a8383b306f4bc6991da8231b5f3924b0.tar.gz
linux-04eeb606a8383b306f4bc6991da8231b5f3924b0.tar.bz2
linux-04eeb606a8383b306f4bc6991da8231b5f3924b0.zip
ALSA: aoa: Use snd_ctl_elem_info()
... and reduce the open codes. Also add missing const to text arrays. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/aoa/codecs/onyx.c')
-rw-r--r--sound/aoa/codecs/onyx.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c
index 401107b85d30..23c371ecfb6b 100644
--- a/sound/aoa/codecs/onyx.c
+++ b/sound/aoa/codecs/onyx.c
@@ -243,13 +243,7 @@ static int onyx_snd_capture_source_info(struct snd_kcontrol *kcontrol,
{
static const char * const texts[] = { "Line-In", "Microphone" };
- uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
- uinfo->count = 1;
- uinfo->value.enumerated.items = 2;
- if (uinfo->value.enumerated.item > 1)
- uinfo->value.enumerated.item = 1;
- strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
- return 0;
+ return snd_ctl_enum_info(uinfo, 1, 2, texts);
}
static int onyx_snd_capture_source_get(struct snd_kcontrol *kcontrol,