memory: ti-aemif: don't needlessly iterate over child nodes
When populating devices from a specific node, we don't need to call of_platform_populate() for every child node manually - the routine will already do it. We can call it directly from the platform device's OF node. While at it: use the managed variant of of_platform_populate(). Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20240809-ti-aemif-v1-3-27b1e5001390@linaro.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
This commit is contained in:
parent
f6ae541cc3
commit
23a641d5c2
@ -383,13 +383,9 @@ static int aemif_probe(struct platform_device *pdev)
|
|||||||
* child will be probed after the AEMIF timing parameters are set.
|
* child will be probed after the AEMIF timing parameters are set.
|
||||||
*/
|
*/
|
||||||
if (np) {
|
if (np) {
|
||||||
for_each_available_child_of_node(np, child_np) {
|
ret = devm_of_platform_populate(dev);
|
||||||
ret = of_platform_populate(child_np, NULL, NULL, dev);
|
if (ret)
|
||||||
if (ret < 0) {
|
return ret;
|
||||||
of_node_put(child_np);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user