Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1256168

[PATCH v4 5/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface

From "Felipe F. Tonello" <eu@felipetonello.com>
Newsgroups linux.kernel
Subject [PATCH v4 5/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface
Date 2015-10-26 18:00 +0100
Message-ID <qnThN-2d0-35@gated-at.bofh.it> (permalink)
References <qnThM-2d0-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This avoids duplication of USB requests for OUT endpoint and
re-enabling endpoints.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.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 0e9cdeb..a617df3 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -323,6 +323,10 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
 	unsigned i;
 	int err;
 
+	/* We don't care if it is not MIDIStreaming interface */
+	if (intf != ms_interface_desc.bInterfaceNumber)
+		return 0;
+
 	err = f_midi_start_ep(midi, f, midi->in_ep);
 	if (err)
 		return err;
-- 
2.1.4

--
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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/7] USB MIDI Gadget improvements and bug fixes "Felipe F. Tonello" <eu@felipetonello.com> - 2015-10-26 18:00 +0100
  [PATCH v4 3/7] usb: gadget: define free_ep_req as universal function "Felipe F. Tonello" <eu@felipetonello.com> - 2015-10-26 18:00 +0100
    Re: [PATCH v4 3/7] usb: gadget: define free_ep_req as universal  function Robert Baldyga <r.baldyga@samsung.com> - 2015-10-27 08:00 +0100
      Re: [PATCH v4 3/7] usb: gadget: define free_ep_req as universal  function Felipe Ferreri Tonello <eu@felipetonello.com> - 2015-10-27 10:20 +0100
        Re: [PATCH v4 3/7] usb: gadget: define free_ep_req as universal  function Robert Baldyga <r.baldyga@samsung.com> - 2015-10-27 10:50 +0100
          Re: [PATCH v4 3/7] usb: gadget: define free_ep_req as universal  function Felipe Ferreri Tonello <eu@felipetonello.com> - 2015-10-27 14:00 +0100
  [PATCH v4 6/7] usb: gadget: gmidi: Cleanup legacy code "Felipe F. Tonello" <eu@felipetonello.com> - 2015-10-26 18:00 +0100
  [PATCH v4 5/7] usb: gadget: f_midi: set altsettings only for MIDIStreaming interface "Felipe F. Tonello" <eu@felipetonello.com> - 2015-10-26 18:00 +0100
    Re: [PATCH v4 5/7] usb: gadget: f_midi: set altsettings only for  MIDIStreaming interface Robert Baldyga <r.baldyga@hackerion.com> - 2015-10-26 23:40 +0100
      Re: [PATCH v4 5/7] usb: gadget: f_midi: set altsettings only for  MIDIStreaming interface Felipe Tonello <eu@felipetonello.com> - 2015-10-27 00:00 +0100
        Re: [PATCH v4 5/7] usb: gadget: f_midi: set altsettings only for  MIDIStreaming interface Robert Baldyga <r.baldyga@samsung.com> - 2015-10-27 07:50 +0100
          Re: [PATCH v4 5/7] usb: gadget: f_midi: set altsettings only for  MIDIStreaming interface Felipe Ferreri Tonello <eu@felipetonello.com> - 2015-10-27 10:20 +0100
  Re: [PATCH v4 0/7] USB MIDI Gadget improvements and bug fixes Felipe Ferreri Tonello <eu@felipetonello.com> - 2015-10-27 15:20 +0100

csiph-web