Skip to content

Commit

Permalink
drivers: net: cpsw: use of_platform_depopulate()
Browse files Browse the repository at this point in the history
Use of_platform_depopulate() in cpsw_remove() instead of
of_device_unregister(), because CSPW child devices will not be
recreated otherwise on next insmod. of_platform_depopulate() is
correct way now as it will ensure that all steps done in
of_platform_populate() are reverted, including cleaning up of
OF_POPULATED flag.

Signed-off-by: Grygorii Strashko <[email protected]>
Reviewed-by: Mugunthan V N <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
grygoriyS authored and davem330 committed Jul 31, 2016
1 parent 8a0b6dc commit 3bf2cb3
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2564,15 +2564,6 @@ static int cpsw_probe(struct platform_device *pdev)
return ret;
}

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

of_device_unregister(pdev);

return 0;
}

static int cpsw_remove(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
Expand All @@ -2591,7 +2582,7 @@ static int cpsw_remove(struct platform_device *pdev)

cpsw_ale_destroy(priv->ale);
cpdma_ctlr_destroy(priv->dma);
device_for_each_child(&pdev->dev, NULL, cpsw_remove_child_device);
of_platform_depopulate(&pdev->dev);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
if (priv->data.dual_emac)
Expand Down

0 comments on commit 3bf2cb3

Please sign in to comment.