diff options
Diffstat (limited to 'drivers/perf/arm-cci.c')
-rw-r--r-- | drivers/perf/arm-cci.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/perf/arm-cci.c b/drivers/perf/arm-cci.c index 33b47c292d79..e6fadc8e1178 100644 --- a/drivers/perf/arm-cci.c +++ b/drivers/perf/arm-cci.c | |||
@@ -1407,6 +1407,7 @@ static int cci_pmu_init(struct cci_pmu *cci_pmu, struct platform_device *pdev) | |||
1407 | pmu_format_attr_group.attrs = model->format_attrs; | 1407 | pmu_format_attr_group.attrs = model->format_attrs; |
1408 | 1408 | ||
1409 | cci_pmu->pmu = (struct pmu) { | 1409 | cci_pmu->pmu = (struct pmu) { |
1410 | .module = THIS_MODULE, | ||
1410 | .name = cci_pmu->model->name, | 1411 | .name = cci_pmu->model->name, |
1411 | .task_ctx_nr = perf_invalid_context, | 1412 | .task_ctx_nr = perf_invalid_context, |
1412 | .pmu_enable = cci_pmu_enable, | 1413 | .pmu_enable = cci_pmu_enable, |
@@ -1572,6 +1573,7 @@ static const struct of_device_id arm_cci_pmu_matches[] = { | |||
1572 | #endif | 1573 | #endif |
1573 | {}, | 1574 | {}, |
1574 | }; | 1575 | }; |
1576 | MODULE_DEVICE_TABLE(of, arm_cci_pmu_matches); | ||
1575 | 1577 | ||
1576 | static bool is_duplicate_irq(int irq, int *irqs, int nr_irqs) | 1578 | static bool is_duplicate_irq(int irq, int *irqs, int nr_irqs) |
1577 | { | 1579 | { |
@@ -1693,14 +1695,27 @@ static int cci_pmu_probe(struct platform_device *pdev) | |||
1693 | return 0; | 1695 | return 0; |
1694 | } | 1696 | } |
1695 | 1697 | ||
1698 | static int cci_pmu_remove(struct platform_device *pdev) | ||
1699 | { | ||
1700 | if (!g_cci_pmu) | ||
1701 | return 0; | ||
1702 | |||
1703 | cpuhp_remove_state(CPUHP_AP_PERF_ARM_CCI_ONLINE); | ||
1704 | perf_pmu_unregister(&g_cci_pmu->pmu); | ||
1705 | g_cci_pmu = NULL; | ||
1706 | |||
1707 | return 0; | ||
1708 | } | ||
1709 | |||
1696 | static struct platform_driver cci_pmu_driver = { | 1710 | static struct platform_driver cci_pmu_driver = { |
1697 | .driver = { | 1711 | .driver = { |
1698 | .name = DRIVER_NAME, | 1712 | .name = DRIVER_NAME, |
1699 | .of_match_table = arm_cci_pmu_matches, | 1713 | .of_match_table = arm_cci_pmu_matches, |
1700 | }, | 1714 | }, |
1701 | .probe = cci_pmu_probe, | 1715 | .probe = cci_pmu_probe, |
1716 | .remove = cci_pmu_remove, | ||
1702 | }; | 1717 | }; |
1703 | 1718 | ||
1704 | builtin_platform_driver(cci_pmu_driver); | 1719 | module_platform_driver(cci_pmu_driver); |
1705 | MODULE_LICENSE("GPL v2"); | 1720 | MODULE_LICENSE("GPL v2"); |
1706 | MODULE_DESCRIPTION("ARM CCI PMU support"); | 1721 | MODULE_DESCRIPTION("ARM CCI PMU support"); |