mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
driver core: class: mark class_release() as taking a const *
The struct class callback, class_release(), is only called in 2 places, the pcmcia cardservices code, and in the class driver core code. Both places it is safe to mark the structure as a const *, to allow us to in the future mark all struct class usages as constant and move into read-only memory. Acked-by: Rafael J. Wysocki <rafael@kernel.org> Link: https://lore.kernel.org/r/2023040248-outrage-obsolete-5a9a@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -235,7 +235,7 @@ void class_unregister(const struct class *cls)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(class_unregister);
|
||||
|
||||
static void class_create_release(struct class *cls)
|
||||
static void class_create_release(const struct class *cls)
|
||||
{
|
||||
pr_debug("%s called for %s\n", __func__, cls->name);
|
||||
kfree(cls);
|
||||
|
||||
Reference in New Issue
Block a user