chardev: make kobj_type structures constant
Commit Message
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.
Take advantage of this to constify the structure definitions to prevent
modification at runtime.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
fs/char_dev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
base-commit: 033c40a89f55525139fd5b6342281b09b97d05bf
change-id: 20230216-kobj_type-chardev-f0d84e96be2e
Best regards,
@@ -624,11 +624,11 @@ static void cdev_dynamic_release(struct kobject *kobj)
kobject_put(parent);
}
-static struct kobj_type ktype_cdev_default = {
+static const struct kobj_type ktype_cdev_default = {
.release = cdev_default_release,
};
-static struct kobj_type ktype_cdev_dynamic = {
+static const struct kobj_type ktype_cdev_dynamic = {
.release = cdev_dynamic_release,
};