summaryrefslogtreecommitdiffstats
path: root/sound/pci/bt87x.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-01-10 16:27:26 +0100
committerTakashi Iwai <tiwai@suse.de>2011-01-10 16:46:56 +0100
commitdd1224aa3ebfdef6cddcfb68ddcd0e682eaf9f84 (patch)
treecff1d8fd24f0cafbeb87a77cc2285ef1dcc124cc /sound/pci/bt87x.c
parent9600732b6caba595f34acf2abd930098ec9a0b2b (diff)
downloadlinux-stable-dd1224aa3ebfdef6cddcfb68ddcd0e682eaf9f84.tar.gz
linux-stable-dd1224aa3ebfdef6cddcfb68ddcd0e682eaf9f84.tar.bz2
linux-stable-dd1224aa3ebfdef6cddcfb68ddcd0e682eaf9f84.zip
ALSA: bt87x: use enum control info helper
Simplify the info callback by using the snd_ctl_enum_info() helper function. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/bt87x.c')
-rw-r--r--sound/pci/bt87x.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 37e1b5df5ab8..2958a05b5293 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -637,15 +637,9 @@ static struct snd_kcontrol_new snd_bt87x_capture_boost = {
static int snd_bt87x_capture_source_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *info)
{
- static char *texts[3] = {"TV Tuner", "FM", "Mic/Line"};
+ static const char *const texts[3] = {"TV Tuner", "FM", "Mic/Line"};
- info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
- info->count = 1;
- info->value.enumerated.items = 3;
- if (info->value.enumerated.item > 2)
- info->value.enumerated.item = 2;
- strcpy(info->value.enumerated.name, texts[info->value.enumerated.item]);
- return 0;
+ return snd_ctl_enum_info(info, 1, 3, texts);
}
static int snd_bt87x_capture_source_get(struct snd_kcontrol *kcontrol,