driver core: class: make class_register() take a const *

Now that the class code is cleaned up to not modify the class pointer
registered with it, change class_register() to take a const * to allow
the structure to be placed into read-only memory.

Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/2023040248-customary-release-4aec@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Greg Kroah-Hartman
2023-04-02 19:58:47 +02:00
parent 979207cac5
commit 43a7206b09
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ struct class_dev_iter {
const struct device_type *type;
};
int __must_check class_register(struct class *class);
int __must_check class_register(const struct class *class);
void class_unregister(const struct class *class);
bool class_is_registered(const struct class *class);