summaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-20 18:17:17 +0200
committerTakashi Iwai <tiwai@suse.de>2014-10-21 09:00:29 +0200
commitca776a28ae10bb06807f23e807f0f459dab78318 (patch)
tree783884f41509411f7f9c90b73a2deb29e45cca91 /sound/pci
parent6b6b295e8053dd5a005aaa089b5bed4b4a65c632 (diff)
downloadblackbird-obmc-linux-ca776a28ae10bb06807f23e807f0f459dab78318.tar.gz
blackbird-obmc-linux-ca776a28ae10bb06807f23e807f0f459dab78318.zip
ALSA: fm801: Use snd_ctl_enum_info()
... and reduce the open codes. Also add missing const to the text array. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/fm801.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index c5038303a126..d167afffce5f 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -958,17 +958,11 @@ static int snd_fm801_put_double(struct snd_kcontrol *kcontrol,
static int snd_fm801_info_mux(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
- static char *texts[5] = {
+ static const char * const texts[5] = {
"AC97 Primary", "FM", "I2S", "PCM", "AC97 Secondary"
};
- uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
- uinfo->count = 1;
- uinfo->value.enumerated.items = 5;
- if (uinfo->value.enumerated.item > 4)
- uinfo->value.enumerated.item = 4;
- strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
- return 0;
+ return snd_ctl_enum_info(uinfo, 1, 5, texts);
}
static int snd_fm801_get_mux(struct snd_kcontrol *kcontrol,
OpenPOWER on IntegriCloud