mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 08:03:01 +09:00
driver core: class: remove dev_kobj from struct class
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. Acked-by: Rafael J. Wysocki <rafael@kernel.org> Link: https://lore.kernel.org/r/20230331093318.82288-5-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -899,7 +899,6 @@ static int __init genhd_device_init(void)
|
|||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
block_class.dev_kobj = sysfs_dev_block_kobj;
|
|
||||||
error = class_register(&block_class);
|
error = class_register(&block_class);
|
||||||
if (unlikely(error))
|
if (unlikely(error))
|
||||||
return error;
|
return error;
|
||||||
|
|||||||
@@ -197,10 +197,6 @@ int class_register(struct class *cls)
|
|||||||
return error;
|
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.kset = class_kset;
|
||||||
cp->subsys.kobj.ktype = &class_ktype;
|
cp->subsys.kobj.ktype = &class_ktype;
|
||||||
cp->class = cls;
|
cp->class = cls;
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ struct fwnode_handle;
|
|||||||
* @name: Name of the class.
|
* @name: Name of the class.
|
||||||
* @class_groups: Default attributes of this class.
|
* @class_groups: Default attributes of this class.
|
||||||
* @dev_groups: Default attributes of the devices that belong to the 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
|
* @dev_uevent: Called when a device is added, removed from this class, or a
|
||||||
* few other things that generate uevents to add the environment
|
* few other things that generate uevents to add the environment
|
||||||
* variables.
|
* variables.
|
||||||
@@ -55,7 +54,6 @@ struct class {
|
|||||||
|
|
||||||
const struct attribute_group **class_groups;
|
const struct attribute_group **class_groups;
|
||||||
const struct attribute_group **dev_groups;
|
const struct attribute_group **dev_groups;
|
||||||
struct kobject *dev_kobj;
|
|
||||||
|
|
||||||
int (*dev_uevent)(const struct device *dev, struct kobj_uevent_env *env);
|
int (*dev_uevent)(const struct device *dev, struct kobj_uevent_env *env);
|
||||||
char *(*devnode)(const struct device *dev, umode_t *mode);
|
char *(*devnode)(const struct device *dev, umode_t *mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user