]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iommu/arm-smmu: Refactor qcom_smmu structure to include single pointer
authorBibek Kumar Patro <quic_bibekkum@quicinc.com>
Thu, 12 Dec 2024 15:13:59 +0000 (20:43 +0530)
committerWill Deacon <will@kernel.org>
Tue, 7 Jan 2025 13:26:51 +0000 (13:26 +0000)
qcom_smmu_match_data is static and constant so refactor qcom_smmu to
store single pointer to qcom_smmu_match_data instead of replicating
multiple child members of the same and handle the further dereferences
in the places that want them.

Suggested-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Bibek Kumar Patro <quic_bibekkum@quicinc.com>
Link: https://lore.kernel.org/r/20241212151402.159102-3-quic_bibekkum@quicinc.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h

index 548783f3f8e89fd978367afa65c473002f66e2e7..d03b2239baad48680eb6c3201c85f924ec4a0e07 100644 (file)
@@ -73,7 +73,7 @@ void qcom_smmu_tlb_sync_debug(struct arm_smmu_device *smmu)
        if (__ratelimit(&rs)) {
                dev_err(smmu->dev, "TLB sync timed out -- SMMU may be deadlocked\n");
 
-               cfg = qsmmu->cfg;
+               cfg = qsmmu->data->cfg;
                if (!cfg)
                        return;
 
index 601fb878d0ef25646df434c31304d7ead43c9b05..5f3b5dfdcf05b772d6a6630803a77e8295c39f65 100644 (file)
@@ -507,7 +507,7 @@ static struct arm_smmu_device *qcom_smmu_create(struct arm_smmu_device *smmu,
                return ERR_PTR(-ENOMEM);
 
        qsmmu->smmu.impl = impl;
-       qsmmu->cfg = data->cfg;
+       qsmmu->data = data;
 
        return &qsmmu->smmu;
 }
index 3c134d1a62773ed99133510ee1f82bd08d86e623..b55cd3e3ae48669ebd56f53b1c353aa2fa3bfb92 100644 (file)
@@ -8,7 +8,7 @@
 
 struct qcom_smmu {
        struct arm_smmu_device smmu;
-       const struct qcom_smmu_config *cfg;
+       const struct qcom_smmu_match_data *data;
        bool bypass_quirk;
        u8 bypass_cbndx;
        u32 stall_enabled;