Re: [PATCH] [RFC] usb: dwc2: Run the core connect in dwc2_hcd_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marek,

On 5/15/2020 11:41 AM, Minas Harutyunyan wrote:
> Hi Marek,

Any update on on this patch testing?

Thanks,
Minas

>>
> Could you please test with this patch.
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 12b98b466287..7faf5f8c056d 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -4920,12 +4920,6 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg)
>    					  epnum, 0);
>    	}
> 
> -	ret = usb_add_gadget_udc(dev, &hsotg->gadget);
> -	if (ret) {
> -		dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep,
> -					   hsotg->ctrl_req);
> -		return ret;
> -	}
>    	dwc2_hsotg_dump(hsotg);
> 
>    	return 0;
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 8ea4a24637fa..603b85cd8ed3 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -537,6 +537,16 @@ static int dwc2_driver_probe(struct platform_device
> *dev)
>    	if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
>    		dwc2_lowlevel_hw_disable(hsotg);
> 
> +	/* Postponed adding a new gadget to the udc class driver list */
> +	if (hsotg->gadget_enabled) {
> +		retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget);
> +		if (retval) {
> +			dwc2_hsotg_remove(hsotg);
> +			goto error_init;
> +		}
> +
> +	}
> +
>    	return 0;
> 
>    error_init:
> 
> 
> 
> Thanks,
> Minas
> 




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux