driver core: class: remove subsystem private pointer from struct class
Now that the last users of the subsystem private pointer in struct class are gone, the pointer can be removed, as no one is using it. One step closer to allowing struct class to be const and moved into read-only memory. Acked-by: Rafael J. Wysocki <rafael@kernel.org> Link: https://lore.kernel.org/r/20230331093318.82288-3-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6f14c02220
commit
2df418cf4b
@ -97,8 +97,6 @@ static void class_release(struct kobject *kobj)
|
|||||||
|
|
||||||
pr_debug("class '%s': release.\n", class->name);
|
pr_debug("class '%s': release.\n", class->name);
|
||||||
|
|
||||||
class->p = NULL;
|
|
||||||
|
|
||||||
if (class->class_release)
|
if (class->class_release)
|
||||||
class->class_release(class);
|
class->class_release(class);
|
||||||
else
|
else
|
||||||
@ -206,7 +204,6 @@ int class_register(struct class *cls)
|
|||||||
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;
|
||||||
cls->p = cp;
|
|
||||||
|
|
||||||
error = kset_register(&cp->subsys);
|
error = kset_register(&cp->subsys);
|
||||||
if (error)
|
if (error)
|
||||||
@ -222,7 +219,6 @@ int class_register(struct class *cls)
|
|||||||
|
|
||||||
err_out:
|
err_out:
|
||||||
kfree(cp);
|
kfree(cp);
|
||||||
cls->p = NULL;
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(class_register);
|
EXPORT_SYMBOL_GPL(class_register);
|
||||||
|
@ -71,8 +71,6 @@ struct class {
|
|||||||
void (*get_ownership)(const struct device *dev, kuid_t *uid, kgid_t *gid);
|
void (*get_ownership)(const struct device *dev, kuid_t *uid, kgid_t *gid);
|
||||||
|
|
||||||
const struct dev_pm_ops *pm;
|
const struct dev_pm_ops *pm;
|
||||||
|
|
||||||
struct subsys_private *p;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct class_dev_iter {
|
struct class_dev_iter {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user