diff mbox series

[v2,16/30] perf/arm_pmu: Assign parents for event_source devices

Message ID 20240412161057.14099-17-Jonathan.Cameron@huawei.com (mailing list archive)
State New, archived
Headers show
Series Add parents to struct pmu -> dev | expand

Commit Message

Jonathan Cameron April 12, 2024, 4:10 p.m. UTC
Currently the PMU device appears directly under /sys/devices/
Only root busses should appear there, so instead assign the pmu->dev
parent to be the platform device.

Link: https://lore.kernel.org/linux-cxl/ZCLI9A40PJsyqAmq@kroah.com/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/perf/arm_pmu_platform.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Suzuki K Poulose April 16, 2024, 9:36 a.m. UTC | #1
On 12/04/2024 17:10, Jonathan Cameron wrote:
> Currently the PMU device appears directly under /sys/devices/
> Only root busses should appear there, so instead assign the pmu->dev
> parent to be the platform device.
> 
> Link: https://lore.kernel.org/linux-cxl/ZCLI9A40PJsyqAmq@kroah.com/
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>   drivers/perf/arm_pmu_platform.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
> index 3596db36cbff..4b1a9a92ea11 100644
> --- a/drivers/perf/arm_pmu_platform.c
> +++ b/drivers/perf/arm_pmu_platform.c
> @@ -196,6 +196,7 @@ int arm_pmu_device_probe(struct platform_device *pdev,
>   	if (!pmu)
>   		return -ENOMEM;
>   
> +	pmu->pmu.parent = &pdev->dev;
>   	pmu->plat_device = pdev;
>   
>   	ret = pmu_parse_irqs(pmu);


Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
diff mbox series

Patch

diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c
index 3596db36cbff..4b1a9a92ea11 100644
--- a/drivers/perf/arm_pmu_platform.c
+++ b/drivers/perf/arm_pmu_platform.c
@@ -196,6 +196,7 @@  int arm_pmu_device_probe(struct platform_device *pdev,
 	if (!pmu)
 		return -ENOMEM;
 
+	pmu->pmu.parent = &pdev->dev;
 	pmu->plat_device = pdev;
 
 	ret = pmu_parse_irqs(pmu);