Re: [PATCH 1/7] driver core: Add a way to get to bus devices kset

From: Greg KH
Date: Thu Jun 24 2021 - 01:41:41 EST


On Wed, Jun 23, 2021 at 06:22:03PM -0700, kan.liang@xxxxxxxxxxxxxxx wrote:
> From: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
>
> Add an accessor function to get to the bus devices kset associated with
> a struct bus_type.
>
> The user of this is the following perf changes, which will need to get
> to the kobj of the 'devices' directory of a certain bus.

What "following perf changes"?

Nothing should be messing with the kobject of a bus, where are those
patches?

> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> Signed-off-by: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
> Cc: gregkh@xxxxxxxxxxxxxxxxxxx
> Cc: rafael.j.wysocki@xxxxxxxxx
> ---
> drivers/base/bus.c | 6 ++++++
> include/linux/device/bus.h | 1 +
> 2 files changed, 7 insertions(+)
>
> diff --git a/drivers/base/bus.c b/drivers/base/bus.c
> index 36d0c65..3d621a8 100644
> --- a/drivers/base/bus.c
> +++ b/drivers/base/bus.c
> @@ -899,6 +899,12 @@ struct kset *bus_get_kset(struct bus_type *bus)
> }
> EXPORT_SYMBOL_GPL(bus_get_kset);
>
> +struct kset *bus_get_devices_kset(struct bus_type *bus)
> +{
> + return bus->p->devices_kset;
> +}
> +EXPORT_SYMBOL_GPL(bus_get_devices_kset);

No, sorry, this feels really wrong, why does anyone care about the bus
kset?

thanks,

greg k-h