diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2014-10-16 07:33:30 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-11-05 14:36:20 -0500 |
commit | 9caa0d77f7ce6ca0ec6bb81e28a93db1b6287b0f (patch) | |
tree | 8acc45a955e1003763a44e2cee873c611d736516 /drivers/usb/gadget/function | |
parent | 33cfad66efbb72de0ebe72f554b31b6688957052 (diff) |
usb: gadget: f_midi: use usb_gstrings_attach
In order to add configfs support the usb_gstrings_attach must be used.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/function')
-rw-r--r-- | drivers/usb/gadget/function/f_midi.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index 5cd77be95b79..ec2a9cee4589 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c | |||
@@ -717,6 +717,7 @@ static int f_midi_bind(struct usb_configuration *c, struct usb_function *f) | |||
717 | struct usb_midi_out_jack_descriptor_1 jack_out_emb_desc[MAX_PORTS]; | 717 | struct usb_midi_out_jack_descriptor_1 jack_out_emb_desc[MAX_PORTS]; |
718 | struct usb_composite_dev *cdev = c->cdev; | 718 | struct usb_composite_dev *cdev = c->cdev; |
719 | struct f_midi *midi = func_to_midi(f); | 719 | struct f_midi *midi = func_to_midi(f); |
720 | struct usb_string *us; | ||
720 | int status, n, jack = 1, i = 0; | 721 | int status, n, jack = 1, i = 0; |
721 | 722 | ||
722 | midi->gadget = cdev->gadget; | 723 | midi->gadget = cdev->gadget; |
@@ -726,12 +727,13 @@ static int f_midi_bind(struct usb_configuration *c, struct usb_function *f) | |||
726 | goto fail_register; | 727 | goto fail_register; |
727 | 728 | ||
728 | /* maybe allocate device-global string ID */ | 729 | /* maybe allocate device-global string ID */ |
729 | if (midi_string_defs[0].id == 0) { | 730 | us = usb_gstrings_attach(c->cdev, midi_strings, |
730 | status = usb_string_id(c->cdev); | 731 | ARRAY_SIZE(midi_string_defs)); |
731 | if (status < 0) | 732 | if (IS_ERR(us)) { |
732 | goto fail; | 733 | status = PTR_ERR(us); |
733 | midi_string_defs[0].id = status; | 734 | goto fail; |
734 | } | 735 | } |
736 | ac_interface_desc.iInterface = us[STRING_FUNC_IDX].id; | ||
735 | 737 | ||
736 | /* We have two interfaces, AudioControl and MIDIStreaming */ | 738 | /* We have two interfaces, AudioControl and MIDIStreaming */ |
737 | status = usb_interface_id(c, f); | 739 | status = usb_interface_id(c, f); |
@@ -991,7 +993,6 @@ struct usb_function *f_midi_alloc(struct usb_function_instance *fi) | |||
991 | midi->qlen = opts->qlen; | 993 | midi->qlen = opts->qlen; |
992 | 994 | ||
993 | midi->func.name = "gmidi function"; | 995 | midi->func.name = "gmidi function"; |
994 | midi->func.strings = midi_strings; | ||
995 | midi->func.bind = f_midi_bind; | 996 | midi->func.bind = f_midi_bind; |
996 | midi->func.unbind = f_midi_unbind; | 997 | midi->func.unbind = f_midi_unbind; |
997 | midi->func.set_alt = f_midi_set_alt; | 998 | midi->func.set_alt = f_midi_set_alt; |