diff options
| author | Patrick Daly <pdaly@codeaurora.org> | 2016-10-12 22:15:36 -0700 |
|---|---|---|
| committer | Patrick Daly <pdaly@codeaurora.org> | 2017-01-20 16:02:05 -0800 |
| commit | 2829116b1eed58fd5372cab5fe1b1ad9d7228ac7 (patch) | |
| tree | 0671e5d8806007389ef4fb98e3c15433d5b22509 | |
| parent | 74e7bd58a41c72e94474eed114eb58ae6362e735 (diff) | |
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: Patrick Daly <pdaly@codeaurora.org>
| -rw-r--r-- | drivers/iommu/arm-smmu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 70766e208217..fbe2302c4037 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -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, |
