]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ALSA: mts64: Use snd_ctl_elem_info()
authorTakashi Iwai <tiwai@suse.de>
Mon, 20 Oct 2014 16:11:28 +0000 (18:11 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 21 Oct 2014 06:10:54 +0000 (08:10 +0200)
... and reduce the open codes.  Also add missing const to the text array.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/mts64.c

index f5fd448dbc5700b96f061c1800ea369e8bcbf9f1..0388fbbd2c06a68e710b4bd4aed2316314b3312d 100644 (file)
@@ -604,21 +604,11 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_frames = {
 static int snd_mts64_ctl_smpte_fps_info(struct snd_kcontrol *kctl,
                                        struct snd_ctl_elem_info *uinfo)
 {
-       static char *texts[5] = { "24",
-                                 "25",
-                                 "29.97",
-                                 "30D",
-                                 "30"    };
+       static const char * const texts[5] = {
+               "24", "25", "29.97", "30D", "30"
+       };
 
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
-       uinfo->count = 1;
-       uinfo->value.enumerated.items = 5;
-       if (uinfo->value.enumerated.item > 4)
-               uinfo->value.enumerated.item = 4;
-       strcpy(uinfo->value.enumerated.name,
-              texts[uinfo->value.enumerated.item]);
-       
-       return 0;
+       return snd_ctl_enum_info(uinfo, 1, 5, texts);
 }
 
 static int snd_mts64_ctl_smpte_fps_get(struct snd_kcontrol *kctl,