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

Greg KH
2021-06-24T05:41:37Z

On Wed, Jun 23, 2021 at 06:22:03PM -0700, kan.liang@linux.intel.com wrote:
> From: Kan Liang <kan.liang@linux.intel.com>
>
> 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@intel.com>
> Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
> Cc: gregkh@linuxfoundation.org
> Cc: rafael.j.wysocki@intel.com
> ---
> 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