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

ALSA: es1938: 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>

+2 -8
+2 -8
sound/pci/es1938.c
··· 1045 1045 static int snd_es1938_info_mux(struct snd_kcontrol *kcontrol, 1046 1046 struct snd_ctl_elem_info *uinfo) 1047 1047 { 1048 - static char *texts[8] = { 1048 + static const char * const texts[8] = { 1049 1049 "Mic", "Mic Master", "CD", "AOUT", 1050 1050 "Mic1", "Mix", "Line", "Master" 1051 1051 }; 1052 1052 1053 - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1054 - uinfo->count = 1; 1055 - uinfo->value.enumerated.items = 8; 1056 - if (uinfo->value.enumerated.item > 7) 1057 - uinfo->value.enumerated.item = 7; 1058 - strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); 1059 - return 0; 1053 + return snd_ctl_enum_info(uinfo, 1, 8, texts); 1060 1054 } 1061 1055 1062 1056 static int snd_es1938_get_mux(struct snd_kcontrol *kcontrol,