diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2024-08-16 13:54:37 +0300 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2024-08-21 14:41:00 +0300 |
commit | 5e8431f722d95bf58276a3051240c1ebe3cc238d (patch) | |
tree | 46c9792fddb61e0637da03e2d3c94029944ee573 /drivers/memory/ti-aemif.c | |
parent | 82986f5cdd23756e7e0c4fa9e4f590f7516772e9 (diff) | |
download | linux-5e8431f722d95bf58276a3051240c1ebe3cc238d.tar.xz |
memory: ti-aemif: simplify with scoped for each OF child loop
Use scoped for_each_available_child_of_node_scoped() when iterating over
device nodes to make code a bit simpler.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240816-cleanup-h-of-node-put-memory-v2-13-9eed0ee16b78@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Diffstat (limited to 'drivers/memory/ti-aemif.c')
-rw-r--r-- | drivers/memory/ti-aemif.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/memory/ti-aemif.c b/drivers/memory/ti-aemif.c index a1f1922ea291..3b546eddf5fe 100644 --- a/drivers/memory/ti-aemif.c +++ b/drivers/memory/ti-aemif.c @@ -329,7 +329,6 @@ static int aemif_probe(struct platform_device *pdev) int ret = -ENODEV; struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - struct device_node *child_np; struct aemif_device *aemif; aemif = devm_kzalloc(dev, sizeof(*aemif), GFP_KERNEL); @@ -359,12 +358,10 @@ static int aemif_probe(struct platform_device *pdev) * functions iterate over these nodes and update the cs data * array. */ - for_each_available_child_of_node(np, child_np) { + for_each_available_child_of_node_scoped(np, child_np) { ret = of_aemif_parse_abus_config(pdev, child_np); - if (ret < 0) { - of_node_put(child_np); + if (ret < 0) return ret; - } } } |