[1/4] usb: dwc2: gadget: do not call usb_gadget_unregister_driver()

Message ID 1413595408-2011-1-git-send-email-balbi@ti.com
State Accepted
Commit 0d3ca262699fd6d7c5dcc25ff29a711851797117
Headers show

Commit Message

Felipe Balbi Oct. 18, 2014, 1:23 a.m.
that call is completely unnecessary because
usb_del_gadget_udc() already makes sure the
gadget driver is properly unregistered from
the UDC.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---

found while reading code

 drivers/usb/dwc2/gadget.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Paul Zimmerman Oct. 20, 2014, 6:35 p.m. | #1
> From: Felipe Balbi [mailto:balbi@ti.com]
> Sent: Friday, October 17, 2014 6:23 PM
> 
> that call is completely unnecessary because
> usb_del_gadget_udc() already makes sure the
> gadget driver is properly unregistered from
> the UDC.
> 
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
> 
> found while reading code
> 
>  drivers/usb/dwc2/gadget.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index e55ba85..8f1502f 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -3608,14 +3608,7 @@ static int s3c_hsotg_remove(struct platform_device *pdev)
>  	struct s3c_hsotg *hsotg = platform_get_drvdata(pdev);
> 
>  	usb_del_gadget_udc(&hsotg->gadget);
> -
>  	s3c_hsotg_delete_debug(hsotg);
> -
> -	if (hsotg->driver) {
> -		/* should have been done already by driver model core */
> -		usb_gadget_unregister_driver(hsotg->driver);
> -	}
> -
>  	clk_disable_unprepare(hsotg->clk);
> 
>  	return 0;

Looks good to me.

Acked-by: Paul Zimmerman <paulz@synopsys.com>

Patch

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index e55ba85..8f1502f 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3608,14 +3608,7 @@  static int s3c_hsotg_remove(struct platform_device *pdev)
 	struct s3c_hsotg *hsotg = platform_get_drvdata(pdev);
 
 	usb_del_gadget_udc(&hsotg->gadget);
-
 	s3c_hsotg_delete_debug(hsotg);
-
-	if (hsotg->driver) {
-		/* should have been done already by driver model core */
-		usb_gadget_unregister_driver(hsotg->driver);
-	}
-
 	clk_disable_unprepare(hsotg->clk);
 
 	return 0;