[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230119100307.3660-4-hejunhao3@huawei.com>
Date: Thu, 19 Jan 2023 18:03:07 +0800
From: Junhao He <hejunhao3@...wei.com>
To: <will@...nel.org>, <linux-kernel@...r.kernel.org>,
<jonathan.cameron@...wei.com>, <mark.rutland@....com>
CC: <linux-arm-kernel@...ts.infradead.org>,
<zhangshaokun@...ilicon.com>, <catalin.marinas@....com>,
<kernel-team@...roid.com>, <linuxarm@...wei.com>,
<yangyicong@...wei.com>, <f.fangjian@...wei.com>,
<shenyang39@...wei.com>, <prime.zeng@...ilicon.com>,
<hejunhao3@...wei.com>
Subject: [PATCH 3/3] drivers/perf: hisi: Extract initialization of "cpa_pmu->pmu"
Use hisi_pmu_init() function to simplify initialization of "cpa_pmu->pmu".
Signed-off-by: Junhao He <hejunhao3@...wei.com>
---
drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c b/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c
index a9bb73f76be4..4c67d57217a7 100644
--- a/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c
@@ -316,21 +316,7 @@ static int hisi_cpa_pmu_probe(struct platform_device *pdev)
if (!name)
return -ENOMEM;
- cpa_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 = cpa_pmu->pmu_events.attr_groups,
- .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
- };
+ hisi_pmu_init(cpa_pmu, name, THIS_MODULE);
/* Power Management should be disabled before using CPA PMU. */
hisi_cpa_pmu_disable_pm(cpa_pmu);
--
2.33.0
Powered by blists - more mailing lists