diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-20 18:19:41 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-21 09:10:58 +0200 |
commit | c69a637b4df37fc5a011a89e422636ea393af5b0 (patch) | |
tree | ae8528cec0229f21fd742068cc3bc439d7771043 /sound/pci/rme9652/hdspm.c | |
parent | 8d678da9f0afbb951778369510c09b99de608c24 (diff) |
ALSA: hdspm: Use snd_ctl_enum_info()
... and reduce the open codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme9652/hdspm.c')
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 52d86af3ef2d..7f7277bfb66a 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -2645,18 +2645,7 @@ static int hdspm_set_clock_source(struct hdspm * hdspm, int mode) static int snd_hdspm_info_clock_source(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = 1; - uinfo->value.enumerated.items = 9; - - if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) - uinfo->value.enumerated.item = - uinfo->value.enumerated.items - 1; - - strcpy(uinfo->value.enumerated.name, - texts_freq[uinfo->value.enumerated.item+1]); - - return 0; + return snd_ctl_enum_info(uinfo, 1, 9, texts_freq + 1); } static int snd_hdspm_get_clock_source(struct snd_kcontrol *kcontrol, |