Re: [PATCH v4 1/7] usb: gadget: f_midi: Transmit data only when IN ep is enabled

From: Felipe Ferreri Tonello
Date: Tue Oct 27 2015 - 05:21:27 EST


Hi Robert,

On 27/10/15 06:41, Robert Baldyga wrote:
> On 10/26/2015 11:49 PM, Felipe Tonello wrote:
>> Hi Robert,
>>
>> On Mon, Oct 26, 2015 at 10:13 PM, Robert Baldyga
>> <r.baldyga@xxxxxxxxxxxxx> wrote:
>>> Hi Felipe,
>>>
>>> On 10/26/2015 05:55 PM, Felipe F. Tonello wrote:
>>>> This makes sure f_midi doesn't try to enqueue data when the IN endpoint is
>>>> disabled, ie, USB cable is disconnected.
>>>>
>>>> Signed-off-by: Felipe F. Tonello <eu@xxxxxxxxxxxxxxxxx>
>>>> ---
>>>> drivers/usb/gadget/function/f_midi.c | 7 ++++++-
>>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
>>>> index edb84ca..e08f365 100644
>>>> --- a/drivers/usb/gadget/function/f_midi.c
>>>> +++ b/drivers/usb/gadget/function/f_midi.c
>>>> @@ -87,6 +87,7 @@ struct f_midi {
>>>> int index;
>>>> char *id;
>>>> unsigned int buflen, qlen;
>>>> + bool in_ep_enabled;
>>>
>>> It's not necessary, you can use ep->enabled flag instead.
>>
>> There is no such flag in usb_ep struct[1].
>>
>> [1] http://lxr.free-electrons.com/source/include/linux/usb/gadget.h#L170
>
> It's already in next branch of Felipe Balbi's tree.
>
> Look here:
> https://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git/

Cool. Thanks.

I though that this flag would be very useful, but didn't want to add to
the main struct as it seems no other driver cared about this flag. But
it is good to see that it is been merged now.

--
Felipe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/