Skip to content

Commit 2026159

Browse files
krzkwilldeacon
authored andcommitted
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>
1 parent f91879f commit 2026159

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

drivers/iommu/arm/arm-smmu/qcom_iommu.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -761,14 +761,10 @@ static struct platform_driver qcom_iommu_ctx_driver = {
761761

762762
static bool qcom_iommu_has_secure_context(struct qcom_iommu_dev *qcom_iommu)
763763
{
764-
struct device_node *child;
765-
766-
for_each_child_of_node(qcom_iommu->dev->of_node, child) {
764+
for_each_child_of_node_scoped(qcom_iommu->dev->of_node, child) {
767765
if (of_device_is_compatible(child, "qcom,msm-iommu-v1-sec") ||
768-
of_device_is_compatible(child, "qcom,msm-iommu-v2-sec")) {
769-
of_node_put(child);
766+
of_device_is_compatible(child, "qcom,msm-iommu-v2-sec"))
770767
return true;
771-
}
772768
}
773769

774770
return false;

0 commit comments

Comments
 (0)