Skip to content

Commit 3bf2cb3

Browse files
grygoriySdavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Mugunthan V N <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8a0b6dc commit 3bf2cb3

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/net/ethernet/ti/cpsw.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,15 +2564,6 @@ static int cpsw_probe(struct platform_device *pdev)
25642564
return ret;
25652565
}
25662566

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-
25762567
static int cpsw_remove(struct platform_device *pdev)
25772568
{
25782569
struct net_device *ndev = platform_get_drvdata(pdev);
@@ -2591,7 +2582,7 @@ static int cpsw_remove(struct platform_device *pdev)
25912582

25922583
cpsw_ale_destroy(priv->ale);
25932584
cpdma_ctlr_destroy(priv->dma);
2594-
device_for_each_child(&pdev->dev, NULL, cpsw_remove_child_device);
2585+
of_platform_depopulate(&pdev->dev);
25952586
pm_runtime_put_sync(&pdev->dev);
25962587
pm_runtime_disable(&pdev->dev);
25972588
if (priv->data.dual_emac)

0 commit comments

Comments
 (0)