aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-10-20 12:11:28 -0400
committerTakashi Iwai <tiwai@suse.de>2014-10-21 02:10:54 -0400
commit6d416f594bf9a290406d267e2627c5286f51ea59 (patch)
treee304cf4f86bcbb3e7ba09f430e2f3583d844b4b2 /sound/drivers
parent04eeb606a8383b306f4bc6991da8231b5f3924b0 (diff)
ALSA: mts64: Use snd_ctl_elem_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/drivers')
-rw-r--r--sound/drivers/mts64.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c
index f5fd448dbc57..0388fbbd2c06 100644
--- a/sound/drivers/mts64.c
+++ b/sound/drivers/mts64.c
@@ -604,21 +604,11 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_frames = {
604static int snd_mts64_ctl_smpte_fps_info(struct snd_kcontrol *kctl, 604static int snd_mts64_ctl_smpte_fps_info(struct snd_kcontrol *kctl,
605 struct snd_ctl_elem_info *uinfo) 605 struct snd_ctl_elem_info *uinfo)
606{ 606{
607 static char *texts[5] = { "24", 607 static const char * const texts[5] = {
608 "25", 608 "24", "25", "29.97", "30D", "30"
609 "29.97", 609 };
610 "30D",
611 "30" };
612 610
613 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 611 return snd_ctl_enum_info(uinfo, 1, 5, texts);
614 uinfo->count = 1;
615 uinfo->value.enumerated.items = 5;
616 if (uinfo->value.enumerated.item > 4)
617 uinfo->value.enumerated.item = 4;
618 strcpy(uinfo->value.enumerated.name,
619 texts[uinfo->value.enumerated.item]);
620
621 return 0;
622} 612}
623 613
624static int snd_mts64_ctl_smpte_fps_get(struct snd_kcontrol *kctl, 614static int snd_mts64_ctl_smpte_fps_get(struct snd_kcontrol *kctl,