aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2014-09-02 15:12:26 -0400
committerFelipe Balbi <balbi@ti.com>2015-03-09 11:38:49 -0400
commit3d0184d087573b7606de45a8e4f01b6222caa47a (patch)
tree794159882387a2f9e209a0ec115b7540ed4ae1af
parent3da1f6ee3563f84395e5d334349a4c9e25d8cbcb (diff)
usb: dwc3: omap: call of_platform_depopulate() instead
This patch fixes a bug where removing dwc3-omap.ko would not trigger removal of dwc3.ko. of_platform_depopulate() already bakes an easy to use API for removing all our children which were populated during probe(); Let's use that one instead of cooking our own solution. Note that this is kind of a revert of commit c5a1fbc (usb: dwc3: dwc3-omap: Fix the crash on module removal) although we can't simply revert that because a direct call to platform_device_unregister would also be flakey. Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/dwc3/dwc3-omap.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 52e0c4e5e48e..edba5348be18 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -325,15 +325,6 @@ static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
325 return IRQ_HANDLED; 325 return IRQ_HANDLED;
326} 326}
327 327
328static int dwc3_omap_remove_core(struct device *dev, void *c)
329{
330 struct platform_device *pdev = to_platform_device(dev);
331
332 of_device_unregister(pdev);
333
334 return 0;
335}
336
337static void dwc3_omap_enable_irqs(struct dwc3_omap *omap) 328static void dwc3_omap_enable_irqs(struct dwc3_omap *omap)
338{ 329{
339 u32 reg; 330 u32 reg;
@@ -600,7 +591,7 @@ static int dwc3_omap_remove(struct platform_device *pdev)
600 if (omap->extcon_id_dev.edev) 591 if (omap->extcon_id_dev.edev)
601 extcon_unregister_interest(&omap->extcon_id_dev); 592 extcon_unregister_interest(&omap->extcon_id_dev);
602 dwc3_omap_disable_irqs(omap); 593 dwc3_omap_disable_irqs(omap);
603 device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core); 594 of_platform_depopulate(omap->dev);
604 pm_runtime_put_sync(&pdev->dev); 595 pm_runtime_put_sync(&pdev->dev);
605 pm_runtime_disable(&pdev->dev); 596 pm_runtime_disable(&pdev->dev);
606 597