summaryrefslogtreecommitdiffstats
path: root/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
diff options
context:
space:
mode:
authorChen Jun <chenjun102@huawei.com>2022-05-16 13:16:01 +0000
committerWill Deacon <will@kernel.org>2022-06-27 11:14:54 +0100
commite500405dd15d956790859fa532c64d8186445372 (patch)
tree9277a81014b3e03827d8b84effc49a0a6e06dfc5 /drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
parentf5ebeb138fa6eb62d90264f9619019aa8c926a22 (diff)
downloadlinux-e500405dd15d956790859fa532c64d8186445372.tar.bz2
perf: hisi: Extract hisi_pmu_init
Extract the initialization code of hisi_pmu->pmu into a function Signed-off-by: Chen Jun <chenjun102@huawei.com> Link: https://lore.kernel.org/r/20220516131601.48383-1-chenjun102@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c')
-rw-r--r--drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
index 62299ab5a9be..50d0c0a2f1fe 100644
--- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
@@ -516,21 +516,7 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev)
"hisi_sccl%u_ddrc%u", ddrc_pmu->sccl_id,
ddrc_pmu->index_id);
- ddrc_pmu->pmu = (struct pmu) {
- .name = name,
- .module = THIS_MODULE,
- .task_ctx_nr = perf_invalid_context,
- .event_init = hisi_uncore_pmu_event_init,
- .pmu_enable = hisi_uncore_pmu_enable,
- .pmu_disable = hisi_uncore_pmu_disable,
- .add = hisi_uncore_pmu_add,
- .del = hisi_uncore_pmu_del,
- .start = hisi_uncore_pmu_start,
- .stop = hisi_uncore_pmu_stop,
- .read = hisi_uncore_pmu_read,
- .attr_groups = ddrc_pmu->pmu_events.attr_groups,
- .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
- };
+ hisi_pmu_init(&ddrc_pmu->pmu, name, ddrc_pmu->pmu_events.attr_groups, THIS_MODULE);
ret = perf_pmu_register(&ddrc_pmu->pmu, name, -1);
if (ret) {