aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGrygorii Strashko <grygorii.strashko@ti.com>2016-07-28 20:50:36 +0300
committerDavid S. Miller <davem@davemloft.net>2016-07-30 21:00:33 -0700
commit3bf2cb3ab585bd9ef1e46d3f89619bb33f2391de (patch)
treeda0841b00fafe6cad28e61d0fda024f315539789 /drivers/net
parentdrivers: net: cpsw: fix wrong regs access in cpsw_remove (diff)
downloadlinux-dev-3bf2cb3ab585bd9ef1e46d3f89619bb33f2391de.tar.xz
linux-dev-3bf2cb3ab585bd9ef1e46d3f89619bb33f2391de.zip
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')
-rw-r--r--drivers/net/ethernet/ti/cpsw.c11
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:
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);
@@ -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)