Commit 3bf2cb3a authored by Grygorii Strashko's avatar Grygorii Strashko Committed by David S. Miller

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: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8a0b6dc9
...@@ -2564,15 +2564,6 @@ static int cpsw_probe(struct platform_device *pdev) ...@@ -2564,15 +2564,6 @@ static int cpsw_probe(struct platform_device *pdev)
return 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) static int cpsw_remove(struct platform_device *pdev)
{ {
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
...@@ -2591,7 +2582,7 @@ static int cpsw_remove(struct platform_device *pdev) ...@@ -2591,7 +2582,7 @@ static int cpsw_remove(struct platform_device *pdev)
cpsw_ale_destroy(priv->ale); cpsw_ale_destroy(priv->ale);
cpdma_ctlr_destroy(priv->dma); 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_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
if (priv->data.dual_emac) if (priv->data.dual_emac)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment