diff options
author | Chen Jun <chenjun102@huawei.com> | 2022-05-16 13:16:01 +0000 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2022-06-27 11:14:54 +0100 |
commit | e500405dd15d956790859fa532c64d8186445372 (patch) | |
tree | 9277a81014b3e03827d8b84effc49a0a6e06dfc5 /drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | |
parent | f5ebeb138fa6eb62d90264f9619019aa8c926a22 (diff) | |
download | linux-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_pa_pmu.c')
-rw-r--r-- | drivers/perf/hisilicon/hisi_uncore_pa_pmu.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c index a0ee84d97c41..47d3cc9b6eec 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pa_pmu.c @@ -412,21 +412,7 @@ static int hisi_pa_pmu_probe(struct platform_device *pdev) return ret; } - pa_pmu->pmu = (struct pmu) { - .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 = pa_pmu->pmu_events.attr_groups, - .capabilities = PERF_PMU_CAP_NO_EXCLUDE, - }; - + hisi_pmu_init(&pa_pmu->pmu, name, pa_pmu->pmu_events.attr_groups, THIS_MODULE); ret = perf_pmu_register(&pa_pmu->pmu, name, -1); if (ret) { dev_err(pa_pmu->dev, "PMU register failed, ret = %d\n", ret); |