lkml.org 
[lkml]   [2015]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 2/5] usb: gadget: midi: avoid redundant f_midi_set_alt() call
    Date
    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>
    ---
    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


    \
     
     \ /
      Last update: 2015-07-08 11:21    [W:3.128 / U:0.880 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site