diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-13 08:19:37 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-13 08:19:37 +0200 |
commit | 991919e969043a4422dfebbcadf600a5d28b94e4 (patch) | |
tree | 4776f9f162c665a9735198fafc466d3e49a14253 /sound/usb/midi.c | |
parent | 73ed6faed58e5611abfb54c2f703eec091781d63 (diff) | |
parent | 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3 (diff) |
Merge 6.15-rc6 into char-misc-next
We need the iio/hyperv fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/usb/midi.c')
-rw-r--r-- | sound/usb/midi.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sound/usb/midi.c b/sound/usb/midi.c index dcdd7e9e1ae97..cfed000f243ab 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1885,10 +1885,18 @@ static void snd_usbmidi_init_substream(struct snd_usb_midi *umidi, } port_info = find_port_info(umidi, number); - name_format = port_info ? port_info->name : - (jack_name != default_jack_name ? "%s %s" : "%s %s %d"); - snprintf(substream->name, sizeof(substream->name), - name_format, umidi->card->shortname, jack_name, number + 1); + if (port_info || jack_name == default_jack_name || + strncmp(umidi->card->shortname, jack_name, strlen(umidi->card->shortname)) != 0) { + name_format = port_info ? port_info->name : + (jack_name != default_jack_name ? "%s %s" : "%s %s %d"); + snprintf(substream->name, sizeof(substream->name), + name_format, umidi->card->shortname, jack_name, number + 1); + } else { + /* The manufacturer included the iProduct name in the jack + * name, do not use both + */ + strscpy(substream->name, jack_name); + } *rsubstream = substream; } |