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

ALSA: via82xx: 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/via82xx.c
··· 1610 1610 /* formerly they were "Line" and "Mic", but it looks like that they 1611 1611 * have nothing to do with the actual physical connections... 1612 1612 */ 1613 - static char *texts[2] = { 1613 + static const char * const texts[2] = { 1614 1614 "Input1", "Input2" 1615 1615 }; 1616 - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1617 - uinfo->count = 1; 1618 - uinfo->value.enumerated.items = 2; 1619 - if (uinfo->value.enumerated.item >= 2) 1620 - uinfo->value.enumerated.item = 1; 1621 - strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); 1622 - return 0; 1616 + return snd_ctl_enum_info(uinfo, 1, 2, texts); 1623 1617 } 1624 1618 1625 1619 static int snd_via8233_capture_source_get(struct snd_kcontrol *kcontrol,