Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2829116b authored by Patrick Daly's avatar Patrick Daly
Browse files

iommu: arm-smmu: Allow configurations with zero clocks



If no clocks are present in devicetree, ensure that smmu->num_clocks is
set to zero instead of an error value.

Change-Id: Ibc3ede250419dd0235f3aa481218e3a91cdb3630
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 74e7bd58
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3531,8 +3531,10 @@ static int arm_smmu_init_clocks(struct arm_smmu_device *smmu)
	smmu->num_clocks =
		of_property_count_strings(dev->of_node, "clock-names");

	if (smmu->num_clocks < 1)
	if (smmu->num_clocks < 1) {
		smmu->num_clocks = 0;
		return 0;
	}

	smmu->clocks = devm_kzalloc(
		dev, sizeof(*smmu->clocks) * smmu->num_clocks,