diff options
author | Grygorii Strashko <grygorii.strashko@ti.com> | 2016-07-28 13:50:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-31 00:00:33 -0400 |
commit | 3bf2cb3ab585bd9ef1e46d3f89619bb33f2391de (patch) | |
tree | da0841b00fafe6cad28e61d0fda024f315539789 /drivers/net/ethernet/ti | |
parent | 8a0b6dc958fd1037931b0e01ebf266fbe3c09e92 (diff) |
drivers: net: cpsw: use of_platform_depopulate()
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 <grygorii.strashko@ti.com>
Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 47d05242b8c4..c51f34693eae 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -2564,15 +2564,6 @@ clean_ndev_ret: | |||
2564 | return ret; | 2564 | return ret; |
2565 | } | 2565 | } |
2566 | 2566 | ||
2567 | static int cpsw_remove_child_device(struct device *dev, void *c) | ||
2568 | { | ||
2569 | struct platform_device *pdev = to_platform_device(dev); | ||
2570 | |||
2571 | of_device_unregister(pdev); | ||
2572 | |||
2573 | return 0; | ||
2574 | } | ||
2575 | |||
2576 | static int cpsw_remove(struct platform_device *pdev) | 2567 | static int cpsw_remove(struct platform_device *pdev) |
2577 | { | 2568 | { |
2578 | struct net_device *ndev = platform_get_drvdata(pdev); | 2569 | struct net_device *ndev = platform_get_drvdata(pdev); |
@@ -2591,7 +2582,7 @@ static int cpsw_remove(struct platform_device *pdev) | |||
2591 | 2582 | ||
2592 | cpsw_ale_destroy(priv->ale); | 2583 | cpsw_ale_destroy(priv->ale); |
2593 | cpdma_ctlr_destroy(priv->dma); | 2584 | cpdma_ctlr_destroy(priv->dma); |
2594 | device_for_each_child(&pdev->dev, NULL, cpsw_remove_child_device); | 2585 | of_platform_depopulate(&pdev->dev); |
2595 | pm_runtime_put_sync(&pdev->dev); | 2586 | pm_runtime_put_sync(&pdev->dev); |
2596 | pm_runtime_disable(&pdev->dev); | 2587 | pm_runtime_disable(&pdev->dev); |
2597 | if (priv->data.dual_emac) | 2588 | if (priv->data.dual_emac) |