On 11/10/2016 3:15 AM, Felipe Balbi wrote:
> 
> Hi,
> 
> John Youn <[email protected]> writes:
>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
>> index 2322863..b9903c6 100644
>> --- a/drivers/usb/dwc3/core.h
>> +++ b/drivers/usb/dwc3/core.h
>> @@ -539,7 +539,6 @@ struct dwc3_ep {
>>  
>>      struct dwc3_trb         *trb_pool;
>>      dma_addr_t              trb_pool_dma;
>> -    const struct usb_ss_ep_comp_descriptor *comp_desc;
>>      struct dwc3             *dwc;
>>  
>>      u32                     saved_state;
>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>> index 7e465ea..0e73383 100644
>> --- a/drivers/usb/dwc3/gadget.c
>> +++ b/drivers/usb/dwc3/gadget.c
>> @@ -576,13 +576,13 @@ static int dwc3_gadget_set_xfer_resource(struct dwc3 
>> *dwc, struct dwc3_ep *dep)
>>   * Caller should take care of locking
>>   */
>>  static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep,
>> -            const struct usb_endpoint_descriptor *desc,
>> -            const struct usb_ss_ep_comp_descriptor *comp_desc,
>>              bool modify, bool restore)
>>  {
>>      struct dwc3             *dwc = dep->dwc;
>>      u32                     reg;
>>      int                     ret;
>> +    struct usb_ep           *ep;
>> +    const struct usb_endpoint_descriptor *desc;
>>  
>>      if (!(dep->flags & DWC3_EP_ENABLED)) {
>>              ret = dwc3_gadget_start_config(dwc, dep);
>> @@ -590,8 +590,10 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep,
>>                      return ret;
>>      }
>>  
>> -    ret = dwc3_gadget_set_ep_config(dwc, dep, desc, comp_desc, modify,
>> -                    restore);
>> +    ep = &dep->endpoint;
>> +    desc = ep->desc;
>> +    ret = dwc3_gadget_set_ep_config(dwc, dep, desc, ep->comp_desc,
>> +                    modify, restore);
>>      if (ret)
>>              return ret;
> 
> this can be improved (see new version below).
> 
>> @@ -713,11 +713,15 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep 
>> *dep)
>>      dwc3_writel(dwc->regs, DWC3_DALEPENA, reg);
>>  
>>      dep->stream_capable = false;
>> -    dep->endpoint.desc = NULL;
>> -    dep->comp_desc = NULL;
>>      dep->type = 0;
>>      dep->flags &= DWC3_EP_END_TRANSFER_PENDING;
>>  
>> +    /* Clear out the ep descriptors for non-ep0 */
>> +    if (dep->number >> 1) {
> 
> Do you mean dep->number > 1 ?

I did mean shift since bit 0 is the direction. But that also works.

Regards,
John
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to