Discussion:
[PATCH 1/4] usb: dwc2: gadget: do not call usb_gadget_unregister_driver()
(too old to reply)
Felipe Balbi
2014-10-18 01:23:25 UTC
Permalink
Raw Message
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-***@public.gmane.org>
---

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);
- }
Felipe Balbi
2014-10-18 01:23:28 UTC
Permalink
Raw Message
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-***@public.gmane.org>
---

found while reading code

drivers/usb/gadget/udc/pxa27x_udc.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index dd6890d..69e7b816 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -2501,7 +2501,6 @@ static int pxa_udc_remove(struct platform_device *_dev)
struct pxa_udc *udc = platform_get_drvdata(_dev);

usb_del_gadget_udc(&udc->gadget);
- usb_gadget_unregister_driver(udc->driver);
pxa_cleanup_debugfs(udc);

usb_put_phy(udc->transceiver);
--
2.1.0.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Robert Jarzmik
2014-10-18 15:07:32 UTC
Permalink
Raw Message
Post by Felipe Balbi
that call is completely unnecessary because
usb_del_gadget_udc() already makes sure the
gadget driver is properly unregistered from
the UDC.
---
found while reading code
drivers/usb/gadget/udc/pxa27x_udc.c | 1 -
1 file changed, 1 deletion(-)
Indeed.

Acked-by: Robert Jarzmik <robert.jarzmik-***@public.gmane.org>

Cheers.

--
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Felipe Balbi
2014-10-18 01:23:27 UTC
Permalink
Raw Message
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-***@public.gmane.org>
---

found while reading code

drivers/usb/gadget/udc/net2272.c | 10 ----------
1 file changed, 10 deletions(-)

diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
index 887bea4..ab3a739 100644
--- a/drivers/usb/gadget/udc/net2272.c
+++ b/drivers/usb/gadget/udc/net2272.c
@@ -2195,18 +2195,8 @@ static void
net2272_remove(struct net2272 *dev)
{
usb_del_gadget_udc(&dev->gadget);
-
- /* start with the driver above us */
- if (dev->driver) {
- /* should have been done already by driver model core */
- dev_warn(dev->dev, "pci remove, driver '%s' is still registered\n",
- dev->driver->driver.name);
- usb_gadget_unregister_driver(dev->driver);
- }
-
free_irq(dev->irq, dev);
iounmap(dev->base_addr);
Felipe Balbi
2014-10-18 01:23:26 UTC
Permalink
Raw Message
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-***@public.gmane.org>
---

found while reading code

drivers/usb/gadget/udc/dummy_hcd.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
index 5bffb75..254b9e7 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -2362,7 +2362,6 @@ static void dummy_stop(struct usb_hcd *hcd)

dum = hcd_to_dummy_hcd(hcd)->dum;
device_remove_file(dummy_dev(hcd_to_dummy_hcd(hcd)), &dev_attr_urbs);
- usb_gadget_unregister_driver(dum->driver);
dev_info(dummy_dev(hcd_to_dummy_hcd(hcd)), "stopped\n");
}
--
2.1.0.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Paul Zimmerman
2014-10-20 18:35:34 UTC
Permalink
Raw Message
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.
---
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-HKixBCOQz3hWk0Htik3J/***@public.gmane.org>
--
Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...