iommu/arm-smmu-qcom: Protect acpi_match_platform_list() call with CONFIG_ACPI
authorShawn Guo <shawn.guo@linaro.org>
Wed, 9 Jun 2021 01:55:11 +0000 (09:55 +0800)
committerWill Deacon <will@kernel.org>
Wed, 9 Jun 2021 10:52:20 +0000 (11:52 +0100)
The struct acpi_platform_list and function acpi_match_platform_list()
defined in include/linux/acpi.h are available only when CONFIG_ACPI is
enabled.  Add protection to fix the build issues with !CONFIG_ACPI.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Link: https://lore.kernel.org/r/20210609015511.3955-1-shawn.guo@linaro.org
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c

index 83c3256..7771d40 100644 (file)
@@ -354,21 +354,25 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = {
        { }
 };
 
+#ifdef CONFIG_ACPI
 static struct acpi_platform_list qcom_acpi_platlist[] = {
        { "LENOVO", "CB-01   ", 0x8180, ACPI_SIG_IORT, equal, "QCOM SMMU" },
        { "QCOM  ", "QCOMEDK2", 0x8180, ACPI_SIG_IORT, equal, "QCOM SMMU" },
        { }
 };
+#endif
 
 struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu)
 {
        const struct device_node *np = smmu->dev->of_node;
 
+#ifdef CONFIG_ACPI
        if (np == NULL) {
                /* Match platform for ACPI boot */
                if (acpi_match_platform_list(qcom_acpi_platlist) >= 0)
                        return qcom_smmu_create(smmu, &qcom_smmu_impl);
        }
+#endif
 
        /*
         * Do not change this order of implementation, i.e., first adreno