Skip to content

Commit

Permalink
usb: dwc3: omap: call of_platform_depopulate() instead
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Balbi committed Mar 9, 2015
1 parent 3da1f6e commit 3d0184d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,15 +325,6 @@ static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
return IRQ_HANDLED;
}

static int dwc3_omap_remove_core(struct device *dev, void *c)
{
struct platform_device *pdev = to_platform_device(dev);

of_device_unregister(pdev);

return 0;
}

static void dwc3_omap_enable_irqs(struct dwc3_omap *omap)
{
u32 reg;
Expand Down Expand Up @@ -600,7 +591,7 @@ static int dwc3_omap_remove(struct platform_device *pdev)
if (omap->extcon_id_dev.edev)
extcon_unregister_interest(&omap->extcon_id_dev);
dwc3_omap_disable_irqs(omap);
device_for_each_child(&pdev->dev, NULL, dwc3_omap_remove_core);
of_platform_depopulate(omap->dev);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);

Expand Down

0 comments on commit 3d0184d

Please sign in to comment.