RE: [PATCH v4 2/5] perf: Allow a PMU to have a parent

From: Dan Williams
Date: Tue Apr 04 2023 - 00:03:40 EST


Jonathan Cameron wrote:
> Some PMUs have well defined parents such as PCI devices.
> As the device_initialize() and device_add() are all within
> pmu_dev_alloc() which is called from perf_pmu_register()
> there is no opportunity to set the parent from within a driver.
>
> Add a struct device *parent field to struct pmu and use that
> to set the parent.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> ---
> v4: No change
> Note that this may first merge as part of a larger series I
> plan to post next week that adds parents for many of the of the
> other struct pmu instances. If so please drop this patch whilst
> applying.

Feel free to add my:

Reviewed-by: Dan Williams <dan.j.williams@xxxxxxxxx>

...whereever this gets applied, and yes it makes sense especially as
more device attached PMUs are showing up.