From: Chen Jun chenjun102@huawei.com
Signed-off-by: Chen Jun chenjun102@huawei.com --- drivers/perf/hisilicon/Kconfig | 2 +- drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/perf/hisilicon/Kconfig b/drivers/perf/hisilicon/Kconfig index c5d1b7019fff..3c2ce1c5d428 100644 --- a/drivers/perf/hisilicon/Kconfig +++ b/drivers/perf/hisilicon/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only config HISI_PMU tristate "HiSilicon SoC PMU drivers" - depends on ARM64 && ACPI + depends on ARM64 help Support for HiSilicon SoC L3 Cache performance monitor, Hydra Home Agent performance monitor and DDR Controller performance monitor. diff --git a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c index 0e61da607d55..1234e3690e91 100644 --- a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c @@ -292,9 +292,6 @@ MODULE_DEVICE_TABLE(acpi, hisi_hha_pmu_acpi_match); static int hisi_hha_pmu_init_data(struct platform_device *pdev, struct hisi_pmu *hha_pmu) { - unsigned long long id; - acpi_status status; - /* * Use SCCL_ID and UID to identify the HHA PMU, while * SCCL_ID is in MPIDR[aff2]. @@ -311,6 +308,9 @@ static int hisi_hha_pmu_init_data(struct platform_device *pdev, */ if (device_property_read_u32(&pdev->dev, "hisilicon,idx-id", &hha_pmu->index_id)) { +#ifdef CONFIG_ACPI + unsigned long long id; + acpi_status status; status = acpi_evaluate_integer(ACPI_HANDLE(&pdev->dev), "_UID", NULL, &id); if (ACPI_FAILURE(status)) { @@ -319,6 +319,9 @@ static int hisi_hha_pmu_init_data(struct platform_device *pdev, }
hha_pmu->index_id = id; +#else + return -EINVAL; +#endif } /* HHA PMUs only share the same SCCL */ hha_pmu->ccl_id = -1;