diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-10-20 20:18:33 +0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-10-21 11:01:06 +0400 |
commit | c4fa251f6f3ed00d59d0d8ee63bf346e6dd6b664 (patch) | |
tree | 832ec29f8dfd1e0596c97015304bff4db1b54902 /sound/pci/ice1712/ews.c | |
parent | 3ff72219320f616489bf0d98ddac12899da4a9ce (diff) | |
download | linux-c4fa251f6f3ed00d59d0d8ee63bf346e6dd6b664.tar.xz |
ALSA: ice1712: Use snd_ctl_enum_info()
... and reduce the open codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712/ews.c')
-rw-r--r-- | sound/pci/ice1712/ews.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c index 817a1bc50a60..5cb587cf360e 100644 --- a/sound/pci/ice1712/ews.c +++ b/sound/pci/ice1712/ews.c @@ -580,13 +580,7 @@ static int snd_ice1712_ewx_io_sense_info(struct snd_kcontrol *kcontrol, struct s static const char * const texts[2] = { "+4dBu", "-10dBV", }; - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = 1; - uinfo->value.enumerated.items = 2; - if (uinfo->value.enumerated.item >= 2) - uinfo->value.enumerated.item = 1; - strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); - return 0; + return snd_ctl_enum_info(uinfo, 1, 2, texts); } static int snd_ice1712_ewx_io_sense_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) @@ -903,13 +897,7 @@ static int snd_ice1712_6fire_select_input_info(struct snd_kcontrol *kcontrol, st static const char * const texts[4] = { "Internal", "Front Input", "Rear Input", "Wave Table" }; - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = 1; - uinfo->value.enumerated.items = 4; - if (uinfo->value.enumerated.item >= 4) - uinfo->value.enumerated.item = 1; - strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); - return 0; + return snd_ctl_enum_info(uinfo, 1, 4, texts); } static int snd_ice1712_6fire_select_input_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |