summaryrefslogtreecommitdiff
path: root/sound/usb/midi.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-01-10 18:30:13 +0300
committerTakashi Iwai <tiwai@suse.de>2011-01-10 18:47:07 +0300
commit2a1803a7291e82823effef0b48b0039324d224c6 (patch)
treeaef83bacecd977821c94466fa38ced959343c6d4 /sound/usb/midi.c
parentbed6896d0be1de12eb6237a43a4beaaf7dcfb42c (diff)
downloadlinux-2a1803a7291e82823effef0b48b0039324d224c6.tar.xz
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>
Diffstat (limited to 'sound/usb/midi.c')
-rw-r--r--sound/usb/midi.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index 25bce7e5b1af..d7021cb01047 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -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,