diff mbox series

[30/32] drivers/nvdimm: Assign parent for event_source device

Message ID 20230404134225.13408-31-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 4, 2023, 1:42 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/
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: nvdimm@lists.linux.dev
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/nvdimm/nd_perf.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dan Williams April 5, 2023, 5:05 a.m. UTC | #1
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/
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: nvdimm@lists.linux.dev
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
diff mbox series

Patch

diff --git a/drivers/nvdimm/nd_perf.c b/drivers/nvdimm/nd_perf.c
index 433bbb68ae64..67de6069edfb 100644
--- a/drivers/nvdimm/nd_perf.c
+++ b/drivers/nvdimm/nd_perf.c
@@ -292,6 +292,7 @@  int register_nvdimm_pmu(struct nvdimm_pmu *nd_pmu, struct platform_device *pdev)
 	 * device data in events functions.
 	 */
 	nd_pmu->dev = &pdev->dev;
+	nd_pmu->pmu.parent = &pdev->dev;
 
 	/* Fill attribute groups for the nvdimm pmu device */
 	nd_pmu->pmu.attr_groups[NVDIMM_PMU_FORMAT_ATTR] = &nvdimm_pmu_format_group;