]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
drivers: net: cpsw: use of_platform_depopulate()
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 28 Jul 2016 17:50:36 +0000 (20:50 +0300)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 20 Oct 2016 13:06:34 +0000 (08:06 -0500)
BugLink: http://bugs.launchpad.net/bugs/1625177
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>
(cherry picked from commit 3bf2cb3ab585bd9ef1e46d3f89619bb33f2391de)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/net/ethernet/ti/cpsw.c

index cfe48c8beb6a84b6291c7e425d90579fad7bb5f2..63e51a760daa1f1dfe9558d9e4e6df6db9c8a62e 100644 (file)
@@ -2519,15 +2519,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);
@@ -2548,7 +2539,7 @@ static int cpsw_remove(struct platform_device *pdev)
        cpdma_chan_destroy(priv->txch);
        cpdma_chan_destroy(priv->rxch);
        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)