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

ALSA: sparc: 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 -10
+2 -10
sound/sparc/cs4231.c
··· 1285 1285 static int snd_cs4231_info_mux(struct snd_kcontrol *kcontrol, 1286 1286 struct snd_ctl_elem_info *uinfo) 1287 1287 { 1288 - static char *texts[4] = { 1288 + static const char * const texts[4] = { 1289 1289 "Line", "CD", "Mic", "Mix" 1290 1290 }; 1291 1291 1292 - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1293 - uinfo->count = 2; 1294 - uinfo->value.enumerated.items = 4; 1295 - if (uinfo->value.enumerated.item > 3) 1296 - uinfo->value.enumerated.item = 3; 1297 - strcpy(uinfo->value.enumerated.name, 1298 - texts[uinfo->value.enumerated.item]); 1299 - 1300 - return 0; 1292 + return snd_ctl_enum_info(uinfo, 2, 4, texts); 1301 1293 } 1302 1294 1303 1295 static int snd_cs4231_get_mux(struct snd_kcontrol *kcontrol,