diff mbox series

[07/32] perf/amlogic: Assign parents for event_source devices

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

Commit Message

Jonathan Cameron April 4, 2023, 1:42 p.m. UTC
Currently all these devices appear directly under /sys/devices/
Only root busses should appear there, so instead assign the pmu->dev
parents to be the platform device.

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

Comments

Jiucheng Xu April 10, 2023, 2 a.m. UTC | #1
On 2023/4/4 21:42, Jonathan Cameron wrote:
> [ EXTERNAL EMAIL ]
>
> Currently all these devices appear directly under /sys/devices/
> Only root busses should appear there, so instead assign the pmu->dev
> parents to be the platform device.
>
> Link: https://lore.kernel.org/linux-cxl/ZCLI9A40PJsyqAmq@kroah.com/
> Cc: Jiucheng Xu <jiucheng.xu@amlogic.com>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>   drivers/perf/amlogic/meson_ddr_pmu_core.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/perf/amlogic/meson_ddr_pmu_core.c b/drivers/perf/amlogic/meson_ddr_pmu_core.c
> index b84346dbac2c..e0d3e87457e0 100644
> --- a/drivers/perf/amlogic/meson_ddr_pmu_core.c
> +++ b/drivers/perf/amlogic/meson_ddr_pmu_core.c
> @@ -490,6 +490,7 @@ int meson_ddr_pmu_create(struct platform_device *pdev)
>   	*pmu = (struct ddr_pmu) {
>   		.pmu = {
>   			.module		= THIS_MODULE,
> +			.parent		= &pdev->dev,
Reviewed-by: Jiucheng Xu <jiucheng.xu@amlogic.com
>   			.capabilities	= PERF_PMU_CAP_NO_EXCLUDE,
>   			.task_ctx_nr	= perf_invalid_context,
>   			.attr_groups	= attr_groups,
diff mbox series

Patch

diff --git a/drivers/perf/amlogic/meson_ddr_pmu_core.c b/drivers/perf/amlogic/meson_ddr_pmu_core.c
index b84346dbac2c..e0d3e87457e0 100644
--- a/drivers/perf/amlogic/meson_ddr_pmu_core.c
+++ b/drivers/perf/amlogic/meson_ddr_pmu_core.c
@@ -490,6 +490,7 @@  int meson_ddr_pmu_create(struct platform_device *pdev)
 	*pmu = (struct ddr_pmu) {
 		.pmu = {
 			.module		= THIS_MODULE,
+			.parent		= &pdev->dev,
 			.capabilities	= PERF_PMU_CAP_NO_EXCLUDE,
 			.task_ctx_nr	= perf_invalid_context,
 			.attr_groups	= attr_groups,