summaryrefslogtreecommitdiff
path: root/drivers/memory
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-08-09 16:15:56 +0200
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2024-08-12 12:32:11 +0200
commit23a641d5c2bce4c723fff9118a5d865ee6b9d05a (patch)
tree58db215f9c4a0447dd6f72de8896176afe977b1d /drivers/memory
parentf6ae541cc3355fe872d4c942dc47d67877951d17 (diff)
downloadlwn-23a641d5c2bce4c723fff9118a5d865ee6b9d05a.tar.gz
lwn-23a641d5c2bce4c723fff9118a5d865ee6b9d05a.zip
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>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/ti-aemif.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c
index fbe0786f5ac4..49e7cbe98fdb 100644
--- a/drivers/memory/ti-aemif.c
+++ b/drivers/memory/ti-aemif.c
@@ -383,13 +383,9 @@ static int aemif_probe(struct platform_device *pdev)
* child will be probed after the AEMIF timing parameters are set.
*/
if (np) {
- for_each_available_child_of_node(np, child_np) {
- ret = of_platform_populate(child_np, NULL, NULL, dev);
- if (ret < 0) {
- of_node_put(child_np);
- return ret;
- }
- }
+ ret = devm_of_platform_populate(dev);
+ if (ret)
+ return ret;
}
return 0;