summaryrefslogtreecommitdiff
path: root/sound/usb
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/midi2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/usb/midi2.c b/sound/usb/midi2.c
index 2ac3f96216bc..790e4cd5d35c 100644
--- a/sound/usb/midi2.c
+++ b/sound/usb/midi2.c
@@ -896,7 +896,14 @@ static int set_altset(struct snd_usb_midi2_interface *umidi)
static void fill_ump_ep_name(struct snd_ump_endpoint *ump,
struct usb_device *dev, int id)
{
+ int len;
+
usb_string(dev, id, ump->info.name, sizeof(ump->info.name));
+
+ /* trim superfluous "MIDI" suffix */
+ len = strlen(ump->info.name);
+ if (len > 5 && !strcmp(ump->info.name + len - 5, " MIDI"))
+ ump->info.name[len - 5] = 0;
}
/* fill the fallback name string for each rawmidi instance */