[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260102125003.64962-2-krzysztof.kozlowski@oss.qualcomm.com>
Date: Fri, 2 Jan 2026 13:50:04 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>
To: Rob Clark <robin.clark@....qualcomm.com>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>, Joerg Roedel <joro@...tes.org>,
iommu@...ts.linux.dev, linux-arm-msm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>
Subject: [PATCH] iommu: arm-smmu: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@....qualcomm.com>
---
drivers/iommu/arm/arm-smmu/qcom_iommu.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
index f69d9276dc55..c98bed38c58a 100644
--- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
+++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
@@ -761,14 +761,10 @@ static struct platform_driver qcom_iommu_ctx_driver = {
static bool qcom_iommu_has_secure_context(struct qcom_iommu_dev *qcom_iommu)
{
- struct device_node *child;
-
- for_each_child_of_node(qcom_iommu->dev->of_node, child) {
+ for_each_child_of_node_scoped(qcom_iommu->dev->of_node, child) {
if (of_device_is_compatible(child, "qcom,msm-iommu-v1-sec") ||
- of_device_is_compatible(child, "qcom,msm-iommu-v2-sec")) {
- of_node_put(child);
+ of_device_is_compatible(child, "qcom,msm-iommu-v2-sec"))
return true;
- }
}
return false;
--
2.51.0
Powered by blists - more mailing lists