[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jj_Jus-8wacxu4GdpvDVPJZaWA+ZdNfW2BgoCJxcunVw@mail.gmail.com>
Date: Fri, 31 Mar 2023 16:50:13 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org,
"Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH 5/7] driver core: class: remove dev_kobj from struct class
On Fri, Mar 31, 2023 at 11:33 AM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> The dev_kobj field in struct class is now only written to, but never
> read from, so it can be removed as it is useless.
>
> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Acked-by: Rafael J. Wysocki <rafael@...nel.org>
> ---
> block/genhd.c | 1 -
> drivers/base/class.c | 4 ----
> include/linux/device/class.h | 2 --
> 3 files changed, 7 deletions(-)
>
> diff --git a/block/genhd.c b/block/genhd.c
> index e1e1230b1b9f..af7208a37c53 100644
> --- a/block/genhd.c
> +++ b/block/genhd.c
> @@ -899,7 +899,6 @@ static int __init genhd_device_init(void)
> {
> int error;
>
> - block_class.dev_kobj = sysfs_dev_block_kobj;
> error = class_register(&block_class);
> if (unlikely(error))
> return error;
> diff --git a/drivers/base/class.c b/drivers/base/class.c
> index fcfb295363cc..06b96d6faa19 100644
> --- a/drivers/base/class.c
> +++ b/drivers/base/class.c
> @@ -197,10 +197,6 @@ int class_register(struct class *cls)
> return error;
> }
>
> - /* set the default /sys/dev directory for devices of this class */
> - if (!cls->dev_kobj)
> - cls->dev_kobj = sysfs_dev_char_kobj;
> -
> cp->subsys.kobj.kset = class_kset;
> cp->subsys.kobj.ktype = &class_ktype;
> cp->class = cls;
> diff --git a/include/linux/device/class.h b/include/linux/device/class.h
> index f7aad64e256a..e946642c314e 100644
> --- a/include/linux/device/class.h
> +++ b/include/linux/device/class.h
> @@ -27,7 +27,6 @@ struct fwnode_handle;
> * @name: Name of the class.
> * @class_groups: Default attributes of this class.
> * @dev_groups: Default attributes of the devices that belong to the class.
> - * @dev_kobj: The kobject that represents this class and links it into the hierarchy.
> * @dev_uevent: Called when a device is added, removed from this class, or a
> * few other things that generate uevents to add the environment
> * variables.
> @@ -55,7 +54,6 @@ struct class {
>
> const struct attribute_group **class_groups;
> const struct attribute_group **dev_groups;
> - struct kobject *dev_kobj;
>
> int (*dev_uevent)(const struct device *dev, struct kobj_uevent_env *env);
> char *(*devnode)(const struct device *dev, umode_t *mode);
> --
> 2.40.0
>
Powered by blists - more mailing lists