The MIDI USB gadget driver has "index" and "id" parameters which should determine the alsa sound card index and id to use when registering the card. Those parameters had no effect, as the relevant information is only set on the midi structure after f_midi_register_card is called. This patch moves the two initialisation statements before the function call. Signed-off-by: Marcus Weseloh <marcus@xxxxxxxxxx> --- drivers/usb/gadget/function/f_midi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index 807b31c..674ba06 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c @@ -954,6 +954,8 @@ int __init f_midi_bind_config(struct usb_configuration *c, /* set up ALSA midi devices */ midi->in_ports = in_ports; midi->out_ports = out_ports; + midi->id = kstrdup(id, GFP_KERNEL); + midi->index = index; status = f_midi_register_card(midi); if (status < 0) goto setup_fail; @@ -965,8 +967,6 @@ int __init f_midi_bind_config(struct usb_configuration *c, midi->func.set_alt = f_midi_set_alt; midi->func.disable = f_midi_disable; - midi->id = kstrdup(id, GFP_KERNEL); - midi->index = index; midi->buflen = buflen; midi->qlen = qlen; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html