Message ID | 20200806153650.3883530-1-thierry.reding@gmail.com |
---|---|
State | New |
Headers | show |
Series | of: platform: Destroy child devices symmetrically | expand |
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 071f04da32c8..b557a0fcd4ba 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -590,7 +590,7 @@ EXPORT_SYMBOL_GPL(of_platform_device_destroy); void of_platform_depopulate(struct device *parent) { if (parent->of_node && of_node_check_flag(parent->of_node, OF_POPULATED_BUS)) { - device_for_each_child(parent, NULL, of_platform_device_destroy); + device_for_each_child_reverse(parent, NULL, of_platform_device_destroy); of_node_clear_flag(parent->of_node, OF_POPULATED_BUS); } }