Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1182623
| From | Robert Baldyga <r.baldyga@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 2/5] usb: gadget: midi: avoid redundant f_midi_set_alt() call |
| Date | 2015-07-13 11:10 +0200 |
| Message-ID | <pLHUn-3aG-33@gated-at.bofh.it> (permalink) |
| References | <pLHUm-3aG-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Function midi registers two interfaces with single set_alt() function which means that f_midi_set_alt() is called twice when configuration is set. That means that endpoint initialization and ep request allocation is done two times. To avoid this problem we do such things only once, for interface number 1 (MIDI Streaming interface). Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> --- drivers/usb/gadget/function/f_midi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c index 6316aa5..4cef222 100644 --- a/drivers/usb/gadget/function/f_midi.c +++ b/drivers/usb/gadget/function/f_midi.c @@ -329,6 +329,10 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt) unsigned i; int err; + /* For Control Device interface we do nothing */ + if (intf == 0) + return 0; + err = f_midi_start_ep(midi, f, midi->in_ep); if (err) return err; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v3 0/5] usb: gadget: miscellaneous fixes Robert Baldyga <r.baldyga@samsung.com> - 2015-07-13 11:10 +0200 [PATCH v3 3/5] usb: isp1760: udc: add missing usb_ep_set_maxpacket_limit() Robert Baldyga <r.baldyga@samsung.com> - 2015-07-13 11:10 +0200 [PATCH v3 2/5] usb: gadget: midi: avoid redundant f_midi_set_alt() call Robert Baldyga <r.baldyga@samsung.com> - 2015-07-13 11:10 +0200
csiph-web