提交 b46e60f4 编写于 作者: J Junhao He 提交者: Ma Wupeng

drivers/perf: hisi: Extract initialization of "cpa_pmu->pmu"

mainline inclusion
from mainline-v6.3-rc1
commit e126f6f4
category: cleanup
bugzilla: https://gitee.com/openeuler/kernel/issues/I77IH6
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e126f6f42f89baee09e088ab6bc48f83ac3a0eae

----------------------------------------------------------------------

Use hisi_pmu_init() function to simplify initialization of "cpa_pmu->pmu".
Signed-off-by: NJunhao He <hejunhao3@huawei.com>
Link: https://lore.kernel.org/r/20230119100307.3660-4-hejunhao3@huawei.comSigned-off-by: NWill Deacon <will@kernel.org>
上级 bcfa573a
...@@ -319,21 +319,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *pdev) ...@@ -319,21 +319,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *pdev)
if (!name) if (!name)
return -ENOMEM; return -ENOMEM;
cpa_pmu->pmu = (struct pmu) { hisi_pmu_init(cpa_pmu, name, THIS_MODULE);
.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 = cpa_pmu->pmu_events.attr_groups,
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
};
/* Power Management should be disabled before using CPA PMU. */ /* Power Management should be disabled before using CPA PMU. */
hisi_cpa_pmu_disable_pm(cpa_pmu); hisi_cpa_pmu_disable_pm(cpa_pmu);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册