From: mina86@mina86.com (Michal Nazarewicz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] usb: gadget: midi: avoid redundant f_midi_set_alt() call
Date: Wed, 08 Jul 2015 15:45:43 +0200 [thread overview]
Message-ID: <xa1tfv4ydapk.fsf@mina86.com> (raw)
In-Reply-To: <1436346323-31593-3-git-send-email-r.baldyga@samsung.com>
On Wed, Jul 08 2015, Robert Baldyga wrote:
> 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
>
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Micha? ?mina86? Nazarewicz (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--
WARNING: multiple messages have this Message-ID (diff)
From: Michal Nazarewicz <mina86@mina86.com>
To: Robert Baldyga <r.baldyga@samsung.com>,
gregkh@linuxfoundation.org, balbi@ti.com
Cc: nicolas.ferre@atmel.com, dan.carpenter@oracle.com,
sergei.shtylyov@cogentembedded.com, andrzej.p@samsung.com,
m.szyprowski@samsung.com, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Robert Baldyga <r.baldyga@samsung.com>
Subject: Re: [PATCH v2 2/5] usb: gadget: midi: avoid redundant f_midi_set_alt() call
Date: Wed, 08 Jul 2015 15:45:43 +0200 [thread overview]
Message-ID: <xa1tfv4ydapk.fsf@mina86.com> (raw)
In-Reply-To: <1436346323-31593-3-git-send-email-r.baldyga@samsung.com>
On Wed, Jul 08 2015, Robert Baldyga wrote:
> 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
>
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--
next prev parent reply other threads:[~2015-07-08 13:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 9:05 [PATCH v2 0/5] usb: gadget: miscellaneous fixes Robert Baldyga
2015-07-08 9:05 ` Robert Baldyga
2015-07-08 9:05 ` [PATCH v2 1/5] usb: gadget: ffs: call functionfs_unbind() if _ffs_func_bind() fails Robert Baldyga
2015-07-08 9:05 ` Robert Baldyga
2015-07-08 12:03 ` Sergei Shtylyov
2015-07-08 12:03 ` Sergei Shtylyov
2015-07-08 13:44 ` Michal Nazarewicz
2015-07-08 13:44 ` Michal Nazarewicz
2015-07-08 9:05 ` [PATCH v2 2/5] usb: gadget: midi: avoid redundant f_midi_set_alt() call Robert Baldyga
2015-07-08 9:05 ` Robert Baldyga
2015-07-08 13:45 ` Michal Nazarewicz [this message]
2015-07-08 13:45 ` Michal Nazarewicz
2015-07-08 9:05 ` [PATCH v2 3/5] usb: isp1760: udc: add missing usb_ep_set_maxpacket_limit() Robert Baldyga
2015-07-08 9:05 ` Robert Baldyga
2015-07-08 13:46 ` Michal Nazarewicz
2015-07-08 13:46 ` Michal Nazarewicz
2015-07-08 9:05 ` [PATCH v2 4/5] staging: emxx_udc: " Robert Baldyga
2015-07-08 9:05 ` Robert Baldyga
2015-07-08 13:47 ` Michal Nazarewicz
2015-07-08 13:47 ` Michal Nazarewicz
2015-07-08 9:05 ` [PATCH v2 5/5] usb: gadget: atmel_usba_udc: add missing ret value check Robert Baldyga
2015-07-08 9:05 ` Robert Baldyga
2015-07-08 13:47 ` Michal Nazarewicz
2015-07-08 13:47 ` Michal Nazarewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xa1tfv4ydapk.fsf@mina86.com \
--to=mina86@mina86.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.