summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-08-24 09:51:05 +0200
committerTakashi Iwai <tiwai@suse.de>2023-08-24 10:03:15 +0200
commit5f11dd938fe7657899ca79b2ffc4d708e43f4737 (patch)
tree492684835b22931be5c893a78a0eb5552b5f3d94 /sound/core
parent67de40c9df94037769967ba28c7d951afb45b7fb (diff)
ALSA: usb-audio: Attach legacy rawmidi after probing all UMP EPs
The legacy rawmidi devices are the shadows of the main UMP devices, hence it's better to initialize them after all UMP Endpoints are parsed. Then, at the moment the legacy rawmidi is created, we already know the static flag or the proper EP name string, and we can fill those information at UMP core side instead of fiddling the attributes at a later point. Fixes: ec362b63c4b5 ("ALSA: usb-audio: Enable the legacy raw MIDI support") Link: https://lore.kernel.org/r/20230824075108.29958-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/ump.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/ump.c b/sound/core/ump.c
index fbe2892e72fd..b72b6dc36e0b 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -1150,6 +1150,8 @@ int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
if (output)
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT,
&snd_ump_legacy_output_ops);
+ snprintf(rmidi->name, sizeof(rmidi->name), "%s (MIDI 1.0)",
+ ump->info.name);
rmidi->info_flags = ump->core.info_flags & ~SNDRV_RAWMIDI_INFO_UMP;
rmidi->ops = &snd_ump_legacy_ops;
rmidi->private_data = ump;