diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-20 12:21:15 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-21 03:14:28 -0400 |
commit | 5fe0b0e3ea1c8cb704677ef7e85345bb683f9182 (patch) | |
tree | f88c98b133cb6c594a1698b80f442e8175f20ba0 /sound/sparc | |
parent | 9502272163ace71d77d809937216fd669c02364b (diff) |
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>
Diffstat (limited to 'sound/sparc')
-rw-r--r-- | sound/sparc/cs4231.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index 4e91bcaa3664..06606f9bbf78 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c | |||
@@ -1285,19 +1285,11 @@ static int snd_cs4231_timer(struct snd_card *card) | |||
1285 | static int snd_cs4231_info_mux(struct snd_kcontrol *kcontrol, | 1285 | static int snd_cs4231_info_mux(struct snd_kcontrol *kcontrol, |
1286 | struct snd_ctl_elem_info *uinfo) | 1286 | struct snd_ctl_elem_info *uinfo) |
1287 | { | 1287 | { |
1288 | static char *texts[4] = { | 1288 | static const char * const texts[4] = { |
1289 | "Line", "CD", "Mic", "Mix" | 1289 | "Line", "CD", "Mic", "Mix" |
1290 | }; | 1290 | }; |
1291 | 1291 | ||
1292 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1292 | return snd_ctl_enum_info(uinfo, 2, 4, texts); |
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; | ||
1301 | } | 1293 | } |
1302 | 1294 | ||
1303 | static int snd_cs4231_get_mux(struct snd_kcontrol *kcontrol, | 1295 | static int snd_cs4231_get_mux(struct snd_kcontrol *kcontrol, |