diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-20 20:18:50 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-21 11:02:50 +0400 |
commit | 597da2e4dfa04c8ee66b09fce931ab6825bc3e75 (patch) | |
tree | d130e83bdb4dff46addb77f01f1ac6831f202203 /sound/pci/ice1712/pontis.c | |
parent | c4fa251f6f3ed00d59d0d8ee63bf346e6dd6b664 (diff) | |
download | linux-597da2e4dfa04c8ee66b09fce931ab6825bc3e75.tar.xz |
ALSA: ice1724: Use snd_ctl_enum_info()
... and reduce the open codes. Also add missing const to text arrays.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712/pontis.c')
-rw-r--r-- | sound/pci/ice1712/pontis.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 5555eb4b2400..5101f40f6fbd 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c @@ -417,13 +417,7 @@ static int cs_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_inf "Optical", /* RXP1 */ "CD", /* RXP2 */ }; - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = 1; - uinfo->value.enumerated.items = 3; - if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) - uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; - strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); - return 0; + return snd_ctl_enum_info(uinfo, 1, 3, texts); } static int cs_source_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |