lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240809-ti-aemif-v1-3-27b1e5001390@linaro.org>
Date: Fri, 09 Aug 2024 16:15:56 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Santosh Shilimkar <ssantosh@...nel.org>, 
 Krzysztof Kozlowski <krzk@...nel.org>
Cc: linux-kernel@...r.kernel.org, 
 Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: [PATCH 3/3] memory: ti-aemif: don't needlessly iterate over child
 nodes

From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>

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@...aro.org>
---
 drivers/memory/ti-aemif.c | 10 +++-------
 1 file 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;

-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ