ALSA: usb-audio: use enum control info helper
Simplify info callbacks by using the snd_ctl_enum_info() helper function. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:

committed by
Takashi Iwai

parent
bed6896d0b
commit
2a1803a729
@@ -1729,13 +1729,7 @@ static int roland_load_info(struct snd_kcontrol *kcontrol,
|
||||
{
|
||||
static const char *const names[] = { "High Load", "Light Load" };
|
||||
|
||||
info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
||||
info->count = 1;
|
||||
info->value.enumerated.items = 2;
|
||||
if (info->value.enumerated.item > 1)
|
||||
info->value.enumerated.item = 1;
|
||||
strcpy(info->value.enumerated.name, names[info->value.enumerated.item]);
|
||||
return 0;
|
||||
return snd_ctl_enum_info(info, 1, 2, names);
|
||||
}
|
||||
|
||||
static int roland_load_get(struct snd_kcontrol *kcontrol,
|
||||
|
Reference in New Issue
Block a user