firmware: turris-mox-rwtm: make kobj_type structure constant
authorThomas Weißschuh <linux@weissschuh.net>
Fri, 24 Mar 2023 16:27:50 +0000 (16:27 +0000)
committerGregory CLEMENT <gregory.clement@bootlin.com>
Fri, 7 Apr 2023 15:17:00 +0000 (17:17 +0200)
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 definition to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
drivers/firmware/turris-mox-rwtm.c

index 6ea5789a89e2be9626928847456a3bc3b7cae47c..2de0fb139ce1762164d3e64b56793558c6917b4a 100644 (file)
@@ -104,7 +104,7 @@ static void mox_kobj_release(struct kobject *kobj)
        kfree(to_rwtm(kobj)->kobj);
 }
 
-static struct kobj_type mox_kobj_ktype = {
+static const struct kobj_type mox_kobj_ktype = {
        .release        = mox_kobj_release,
        .sysfs_ops      = &kobj_sysfs_ops,
 };