From: Will Deacon <will@kernel.org>
Date: Wed, 9 Mar 2022 12:31:00 +0000
Subject: perf/marvell: Fix !CONFIG_OF build for CN10K DDR PMU driver
Git-commit: 6676a42f1e4f1b8ec166b723a3801b7113c25a0e
Patch-mainline: v5.18-rc1
References: jsc#PED-1765
When compiling the Marvell CN10K DDR PMU driver with CONFIG_OF=n, the
build fails:
| drivers/perf/marvell_cn10k_ddr_pmu.c:723:35: error: 'cn10k_ddr_pmu_of_match' undeclared here (not in a function); did you mean 'cn10k_ddr_pmu_driver'?
Use `of_match_ptr()` to avoid referencing the non-existent match table
in this configuration.
Link: https://lore.kernel.org/r/202203091424.Vfe8J4W9-lkp@intel.com
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Will Deacon <will@kernel.org>
Acked-by: Ivan T. Ivanov <iivanov@suse.de>
---
drivers/perf/marvell_cn10k_ddr_pmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/perf/marvell_cn10k_ddr_pmu.c
+++ b/drivers/perf/marvell_cn10k_ddr_pmu.c
@@ -720,7 +720,7 @@ MODULE_DEVICE_TABLE(of, cn10k_ddr_pmu_of
static struct platform_driver cn10k_ddr_pmu_driver = {
.driver = {
.name = "cn10k-ddr-pmu",
- .of_match_table = cn10k_ddr_pmu_of_match,
+ .of_match_table = of_match_ptr(cn10k_ddr_pmu_of_match),
.suppress_bind_attrs = true,
},
.probe = cn10k_ddr_perf_probe,