summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>2026-01-02 15:50:04 +0300
committerWill Deacon <will@kernel.org>2026-01-06 00:35:55 +0300
commit2026159372bb6ff5e18e63272473eb4549b0779e (patch)
tree753c5ba11ccab4e0070e43ce67c4e8861463966c
parentf91879fdf70bdf369906a20a8980284d3ef1558f (diff)
downloadlinux-2026159372bb6ff5e18e63272473eb4549b0779e.tar.xz
iommu/qcom: 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@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--drivers/iommu/arm/arm-smmu/qcom_iommu.c8
1 files 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;